views:

57

answers:

3

I'm trying to write a full screen application for Windows CE 5.0. I'm using CEGCC under Linux to compile my application, so I'm restricted to Windows API - i.e. no fancy GUI designer stuff, no Visual Studio, no MFC, no .NET.

So far, I tried Microsoft's example using SHFullScreen, but no luck. I do not want to hide the taskbar globally (i.e. I want it to behave normally when my application closes, or should I say crashes, and is unable to restore its state).

Any ideas on this one? A simple program that does this (for sure, not just "I think so"), i.e. displays a window in Windows CE 5.0 (or any Windows CE/Mobile/Embedded I guess, so I at least have a clue) that extends from the top left corner to the bottom right corner of the screen, over the taskbar, would be really helpful.

Google didn't help me much, in case you're asking (but maybe I didn't use the right terms today).

Cheers

+2  A: 

The task bar is meant to be above all windows and is not process dependent, so to get a "full screen" effect, you have to hide it.

Here's a C# version that should be easy to convert to C (since it's mostly P/Invoking C anyway).

Your app can certainly reverse that when it exits (and should), but if it crashes, there's no way for the shell to just "know" that it needs to restore the task bar. Of course if you control the OS, you could always create a new Shell that does monitor for this sceanrio, but I'd advise that you try to make your app not crash instead.

ctacke
My app may crash during development, because I don't have the luxury of an emulator (so I guess I could use another app on the desktop to restore my taskbar manually when this happens). Also, I don't have control of the OS. I going quite hardcore at it.I just hoped that someone knew how to get the function I mentioned to work, since Microsoft documents it for the purpose.
Radu C
SHFullScreen is not guaranteed to be present - it's in aygshell, so if that isn't in the OS, you won't have it. Calling the APIs in the link I posted is more universal.
ctacke
It is present on my device.
Radu C
+1  A: 

You can use Structured Exception Handling (SEH) to restore the task bar before crashing.

Trevor Balcom
Worth noting that this will only work if SEH is part of the OS image.
ctacke
+1  A: 

I managed to solve all my requirements by putting this in WndProc under case WM_CREATE:

int ScreenWidth = GetSystemMetrics(SM_CXSCREEN);
int ScreenHeight = GetSystemMetrics(SM_CYSCREEN);

SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, ScreenWidth, ScreenHeight, 0);
HWND TaskBarWnd = FindWindow("HHTaskBar", "");
if (TaskBarWnd != NULL)
    SetWindowPos(TaskBarWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
Radu C