if (FrmGetWindowHandle(frmP) == WinGetActiveWindow())
{
draw
}It works fine in that it stops me from drawing when I am not active, aka when a menu is open, or the command bar. The problem is that when I exit a form called with FrmPopupForm that did not have save behind enabled, I get a FrmUpdateEvent posted to my main form's event handler before the system has switched the window back. My code catches that I'm not the current window and doesn't redraw.
Is there a better way I should be checking? I don't really like watching for WinEnter and WinExit events since it requires adding yet another global switch. It seems like there should be a call to programmatically tell me if it's safe to draw on the screen.
-Mike
At 11:12 AM 7/2/2003 -0700, you wrote:
This "older" method seemed a lot more straightforward to me. :) But it breaks the Palmsource rules and accesses a structure's internal workings.
The reason we discourage that is because it isn't just menus which might obscure you. Today, yes, they're the #1 thing, but sometimes we know what's coming in the future. Therefore to save you time, we tell you to do something slightly more general.
In other words, the question shouldn't be "is a menu visible" but nearly always ought to be "should I stop drawing because I'm obscured". The window events and active window status are probably what you really want to rely on.
-David Fedor PalmSource, Inc.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
--- Michael A. Waldron, AE0MW http://www.mikew.org PGP: http://www.mikew.org/mypgpkey.txt
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
