PocketMatrix forums

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

Redrawing problem after powering on

I have a problem. Using GAPI I draw some graphics on the screen, however if I power off and back on again, there is no WM_PAINT message (and I get a piece of the desktop showing through).

Shouldn't I get a WM_PAINT if it has overwritten my window? How do I fix this? I get no messages...

Must I resort to redrawing the entire screen each frame?

Pocket PC is iPAQ 3630 with 2002, however I suspect the problem isn't limited to this PPC.
You may receive a WM_ACTIVATE. I can't remember and can't check at the moment. The "worst" case would be to check your game timer, and if there is an excessive time lapse from one frame to another (say 1 sec or more) then the device has been powered off, and you should redraw the whole frame.

Dan East
I'm just doing a quick trace of messages to see if anything useful comes up.

3d7aff P 0 3fc 0 0
turn off, turn on
3ec02d P 4e0450 1f 0 0 WM_CANCELMODE
3ec030 - 4e0450 1f 0 0 WM_CANCELMODE
3ec034 P 0 3fc 0 0
3ec89d - 4e0450 3fe 0 16082548 WM_NETCONNECT
3ec8a1 P 0 3fc 0 0
3ed23f - 4e0450 86 0 0
3ed244 - 4e0450 6 0 0
3ed247 - 4e0450 8 0 0
3ed24e - 4e0450 282 1 0


The Netconnect was because I sillily had it in the USB cradle.

Just wondering, what is the 0x3fc message?
I have defined for 0x3fd-0x3ff, but nothing for 0x3fc?
// New for WINCE
#define WM_DBNOTIFICATION 0x03FD
#define WM_NETCONNECT 0x03FE
#define WM_HIBERNATE 0x03FF
angedelamort · 04 Jun 2002, 13:20 UTC
The WM_HIBERNATE is not really working, and not with all device. Like Dan say, the best way is to set a Timer. I've asked not so long ago about possible methods, but there is not a lot. Thanks to microsoft :P They wanted this event to be stealt to the developpers. The OS was suppose to take care of everything. But because we use GAPI or any other graphic lib, it can't works properly. That's why we need to do something like that.
WM_HIBERNATE is only sent to an app when the system is critically low on memory in an attempt to get all the running apps to free up as many resources as possible. If enough memory cannot be freed then OS will begin closing apps.

Dan East