Hide taskbar while my forms are in the full-screen mode?

maxvisionkipp used Ask the Experts™
I am developing a custom interface for a custom built (specific purpose) computer.

.Net 3.5
Windows XP Pro

I have been given a requirement that the taskbar never be visible when my forms are in full-screen mode.

I set my forms to full-screen using :


The problem I am having is that the taskbar keeps appearing over my forms.

My forms have the TopMost property set to true.

How can I ensure that the taskbar never appears while my forms are in the full-screen mode?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®


That works, but I am left withn another problem.

My application also includes a soft keyboard which I manage in an AppBar.

When I show my keyboard, even though the taskbar is not visible, Windows continues to manage the taskbar space as if the taskbar were there.

I am including an image that reveals the issue.  The area at the bottom of the image where you can see a lanscape photo instead of the keyboard is the taskbar area.  The taskbar is not visible, but Windows manages the space as if it is.
I was able to resolve this last night by:

public static void HideTaskbar() {
IntPtr TaskBarHwnd;
TaskBarHwnd = FindWindow("Shell_traywnd", "");
SetWindowPos(TaskBarHwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW);

Then using this call with TaskBarState.AutoHide to minimize the space the taskbar occupies:

public static void SetTaskBarState(TaskBarState state){
APPBARDATA appBar = CreateAppBarData();
appBar.lParam = (IntPtr)state;
SHAppBarMessage(ABMsg.ABM_SETSTATE, ref appBar);

The reason I have to do the autohide is that I have a form that I manage in an AppBar (a soft-keyboard).  If I don't minimize the taskbar using the autohide then windows won't put my AppBar where the taskbar would be, even though the taskbar is not visible.

So...  unless there is a more direct approach that I should be using, I have a solution.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial