PocketMatrix forums

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

How to switch to Window mode?

Hello,

I tried to modify the HelloGapi samples to switch it to windowed mode, ad it doesn't seems to work.
(I switched GAMEPARAM_FULLSCREEN to 0 and removed the DestroyMenu() calling)

The Pocket PC's menus and bar doesn't appear...

Please Help !!!
I'm not sure if the specific code you're referring to is for GapiDraw or Gapitools, but I've been able to switch between FullScreen and windowed mode in my GapiTools application using the ::SHFullScreen operator with its various flags. You can selectively display the task bar, command/menu bar, start menu, etc...

A good library/reference for how to do this is:
http://www.spbteam.com/pocketpc/article ... creen.html

You can just extract the key calls to SHFullScreen from this code.

One tricky aspect of fullscreen mode, at least with GapiDraw, is to keep your app at the top of the Z-order. Apparently Windows CE has a bug wherein it doesn't put the taskbar/SIP/startmenu at the bottom of the Z-order when your app is reactivated (after going to another app, or after a system dialog such as ActiveSync has been popped up or confirmed. The solution to this is to call the fullscreen functions again whenever your app's MainFrm is reactivated (override OnActivate). I reassert the fullscreen options on each OnDraw() of my view class, although this is probably ineffiecient.

One big problem I haven't yet overcome, though, is that when I power off and power back on while my GapiTools-based app is running, OnActivate isn't called so my app doesn't redraw (call OnDraw()) to draw all the static elements of my screen. As far as I can tell, what I have to do is use system notification to have the system try to rerun my app at power-on, and if its already running, to just do the redraw. I tried this but it got ugly (you have to make sure it registers the notification only once). There must be a better way...
Doesn't WinCE send an WM_PAINT message out to a message if it's open on power-up?

I would think you could just capture that message and just redraw the scene.
rmg2768 · 17 May 2002, 21:11 UTC — WM_PAINT on power-on
I thought it would - I overrode the OnPaint function in my view class to call OnDraw to redraw everything static (I have a timer function drawing the dynamic elements), and its not redrawing on power-on. Something's funky, because other CE apps (Today, Tasks, etc) behave properly...
It almost sounds like another argument to use threads for drawing on the PPC. If a thread is running that constantly updates the display no matter what then poweron wouldn't matter... however then we get into the issues sbl talks about on this thread http://forums.pocketmatrix.com/viewtopic.php?t=5552