Re: TrackPopupMenu blocks OnIdle() processing

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



It also stops
(a) when you drop down a menu
(b) while you are resizing the window
(c) while you are dragging the window

This is because these actions all have their own private message loop. I would not be
surprised to find that OnIdle is also blocked by a MessageBox.

You should not be doing time-critical updates in OnIdle. Actually, pretending the Windows
is capable of real-time is a dangerous fantasy.

Note that most solutions such as PostMessage from a separate thread are also subject to
the same problem, because during menuing and dragging, the GetMessage call tends to look
only for mouse events, and ignores other pending events. So I know of no solution that
will actually work in all scenarios.
joe

On Fri, 1 Aug 2008 00:46:20 -0700 (PDT), hpesata <hpesata@xxxxxx> wrote:

Hi !

I wrote an MFC app using VC++ .NET 2003.

our app uses multiple docking panes (holding report ctrls and the
likes) which are implemented in several MFC extension dlls. In a
derived CWinApp::OnIdle() function I update the panes because our tool
displays online measurement data from a connected hardware device.

I realized that the processing of OnIdle() stops when I display a
right mouse button context menu within one of my panes. The processing
justs start again when i select a menu entry within the menu.
from what I was reading about TrackPopupMenu it seems to have a
seperate message pump running which is
different from CWinApp::Run()w which triggers OnIdle().
this also happens when I drag one of the panes around.

what can I do to keep my app displaying data during context menu /
pane-drag operations ?

any help with this would be greatly apreciated,
thanx in advance!

regards,
Hans
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.


Quantcast