PocketMatrix forums

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

Switching back to fullscreen

hi all,

i know this sounds very basic, but somehow i'm not getting this right. my program is running as fullscreen. at a specific point i need to execute another non-fullscreen application (let's say calc.exe) and then switch back to my application. so here is what i'm currently doing:

Code:
::MoveWindow(hWnd, 0, 0, 1,1, TRUE);
::UpdateWindow(hWnd);
::ShowWindow(hWnd, FALSE);
::UpdateWindow(hWnd);
::SHFullScreen( hWnd, SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON | SHFS_SHOWSTARTICON );
::GXSuspend();
::UpdateWindow(hWnd);

startApp();

::Sleep(10000);
::SHFullScreen( hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON );
::MoveWindow(hWnd, 0, 0, getWidth(),getHeight(), TRUE);
::UpdateWindow(hWnd);
::ShowWindow(hWnd, TRUE);
::GXResume();
::SetForegroundWindow(hWnd);
::UpdateWindow(hWnd);


i know that this is maybe a little bit too much but i wanted to make sure i'm missing nothing. my problem is that after i switch back, my application looks fullscreen, but actually is not since clicking on the area where the title bar would be does not work anymore (all stylus messages are sent to the title bar...)

any help would be greatly appreciated
thx,
Daniel
The <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcesdkr/html/_wcesdk_win32_ShowWindow.asp">ShowWindow</a> function looks like it's not expecting TRUE and FALSE as the 2nd parameter, maybe that's a problem? (Guessing a bit here).
you are right. it should be SW_HIDE and SW_SHOW but that does not change a thing here (just tried it...).

Daniel
It might be safer (and much easier) just to shutdown GAPI entirely before launching your app (and re-initialize it afterward). This is what I would do. The semantics of GXSuspend() and GXResume() are too imprecise.
the thing is i run an OpenGL ES program. i'd have to test how the OpenGL context would react on this...

Daniel
You are mixing GX calls with OpenGL|ES ones? No wonder it doesn't work... Or is that documented as working? (I'd be surprised).

In any case, shutting done your graphics (be it GAPI, OpenGL|ES, both or anything else) is probably the easiest thing to do. And it is quite safe.
what i'm doing is calling GXOpenInput() to get the buttons. i'm not using GXOpenDisplay()...

i don't see why this would not be correct.
so this is how i create my window at startup:

Code:
SHFullScreen(hWnd, SHFS_HIDESTARTICON);
SHFullScreen(hWnd, SHFS_HIDESIPBUTTON);
SHFullScreen(hWnd, SHFS_HIDETASKBAR);
MoveWindow(hWnd, 0, 0, cxScreen,cyScreen, TRUE);
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
GXOpenInput();


i don't think that shutting down the OpenGL context and recreating it is an option since there is a large OpenGL library running which does not expect context recreations. i believe it would be quite hard to extend it to have this feature.

all i need is to make the title bar not get the stylus events after my application becomes active again. i'm sure it can't be that difficult.

Daniel
[/quote]
after playing around with this issue i finally managed to get the fullscreen to fully belong to the application again. yet, this solution did not work since i had huge problems with the OpenGL ES application after switching back. sometimes it would work and sometimes it wouldn't. i believe the problem lies in bugs in the OpenGL ES driver on the X50v but that is just an educated guess.

so i did what Thierry suggested and closed the window (which btw can be done without closing the context under EGL, so this causes no problems) and recreate it lateron (rebinding it as a new EGL surface). this works perfectly and seems to be the cleanest solution.

thanks for all suggestions,
Daniel