Article ID: 179363 - Last Review: November 21, 2006 - Revision: 1.3

How To Cover the Task Bar with a Window

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
This article was previously published under Q179363
Expand all | Collapse all

SUMMARY

A taskbar automatically hides itself if a program sizes itself to cover the entire screen.

There is no programmatic way to change the Auto-Hide option (that is left up to the user by design), but if a program takes over the entire screen then it will automatically cover the taskbar.

MORE INFORMATION

To cover the taskbar, you must set the size of the full-screen window explicitly. You cannot just maximize the window. A maximized window takes up the workspace area, which doesn't include the taskbar.

The following sample code causes the specified window to cover the entire primary monitor and cover all taskbars on the primary monitor.
   cx = GetSystemMetrics(SM_CXSCREEN);
   cy = GetSystemMetrics(SM_CYSCREEN);
   SetWindowPos(hwnd,HWND_TOP,0,0,cx,cy,SWP_SHOWWINDOW);
				
This works for all taskbars on the primary monitor, including the shell's taskbar and any others (such as Office's taskbar) that are written to use the standard Desktop Application Toolbar interface.

On Windows 2000, the following conditions must also be met for the taskbar to be covered:
  • The application is the foreground application.
  • Either:
    1. the window's client rectangle covers the entire monitor -or-

    2. the window rectangle covers the entire monitor and the window does not have the WS_THICKFRAME style or does not have the WS_CAPTION style.

APPLIES TO
  • Microsoft Win32 Application Programming Interface
Keywords: 
kbhowto KB179363
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.