Page 1 of 1

How to switch to Window mode?

PostPosted: May 17, 2002 @ 12:29pm
by jul'
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 !!!

Re: How to switch to Window mode?

PostPosted: May 17, 2002 @ 5:10pm
by rmg2768
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...

PostPosted: May 17, 2002 @ 7:01pm
by Hosed

WM_PAINT on power-on

PostPosted: May 17, 2002 @ 10:11pm
by rmg2768

PostPosted: May 18, 2002 @ 6:26pm
by Hosed