Radu C
Radu C

Reputation: 1379

Windows CE 5.0 full screen window with Windows API only

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

Upvotes: 4

Views: 3196

Answers (3)

Radu C
Radu C

Reputation: 1379

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);

Upvotes: 1

Trevor Balcom
Trevor Balcom

Reputation: 3888

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

Upvotes: 1

ctacke
ctacke

Reputation: 67178

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.

Upvotes: 2

Related Questions