views:

311

answers:

4

When AutoHide isn't enough, how can I code to gaurentee the taskbar can't be used/displayed while my application is running?

It's a full (touch)screen application (with no keyboard), that is being used in kiosk mode.

When the application exits it's ok to restore the taskbar.

Thank you!

A: 

You can hide the tray window like this:

HWND trayWnd = FindWindow("Shell_TrayWnd", NULL);

if(trayWnd != NULL) {
    ShowWindow(trayWnd, SW_HIDE);
}
arul
Not a good idea, see linked article in the comment on the other answer.
Joey
The taskbar should hide caller's window in some kind of a retaliation. ;)
macbirdie
I know about the article, I even read Raymond's book. None of the described drawbacks apply here.
arul
Still doesn't make it a good idea if there is a documented approach that works. And the drawback with the taskbar being another window class/title would still apply, by the way.
Joey
+2  A: 

Your application can be fullscreen and overlay the taskbar.

MicTech
see http://blogs.msdn.com/oldnewthing/archive/2005/05/05/414910.aspx
Joey
+1  A: 

You could set your application as shell, that way the taskbar doesn't exist at all.

voyager
+1  A: 

There are two options:

  1. Make your app a full screen window. Don't, however, search for the Taskbar and kill it in any way. It's bad behavior, punished with having yet another backward-compatibility hack in Windows API that Microsoft will have to support forever. Here's a post by Raymond Chen to teach you some manners. ;)
  2. Make it Windows' shell instead of explorer.exe. That one's actually more appropriate, considering that your application is the only one that's supposed to be run on your 'kiosk'.
macbirdie