PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Disable notifications

Does anyone know how I can disable or ignore PocketPC notifications such as "calendar reminders", "low battery"... in my game-application?
The easiest thing to do is check for WM_ACTIVATE messages to see when your app loses focus. If you lose activation, then reactivate your app and bring it back to the foreground. When your app finally exits, any popup messages that occured will still be waiting for the user to dismiss them.

Dan East
OK, I'm with you on the "check for WM_ACTIVATE messages" but how do I "reactivate your app and bring it back to the foreground"?
SetForegroundWindow();

Dan East
That solution didn't really work since my game writes directly to the screen-buffer which means that it's not a window based program. WM_ACTIVE never triggers. I've tried WM_KILLFOCUS and WM_SETFOCUS, both triggers and I redraw the display but the message still appears. :cry:

Any other ideas?
Regardless of GAPI, you should still receive WM_ACTIVATE if any other window appears over top of yours.

Are you calling SetForegroundWindow when you lose focus? You may have to do a message pump after the call to let your window move itself back into the foreground. You will eventually get a WM_PAINT, which is where you should redraw to GAPI, because at that point the other window would be back in the background.

If you want to try to close the popup window, you can get it's handle (WM_ACTIVE and WM_KILLFOCUS both provide the handle to the window that took focus) and send it WM_CLOSE, or send it WM_KEYDOWN with VK_ESCAPE to tell it to close, etc.

Dan East
Johan · 23 Feb 2002, 00:33 UTC — WM_ACTIVATE
Hi,

Dan: Thank's for the tips!

Scoreman: I found that capturing WM_ACTIVATE works as long as one capture it in the parent frame window. I've added an option "Force focus" to OpenTrek so it takes care of it automatically.

One thing I had to check for though is that the new window is not a sibling of the current frame window (e.g. a dialog), since it's "OK" button otherwise will be hidden by that of CMainWnd - the (X).

/Sanneblad
www.opentrek.com
www.gapitools.com