HOWTO: Cover the Task Bar with a Window

Last reviewed: January 15, 1998
Article ID: Q179363
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with: - Microsoft Windows NT 4.0 - Microsoft Windows 95

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 code fragment 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.


Additional query words: tray auto hide autohide
Keywords : UsrShell
Version : WINNT:4.0
Platform : winnt
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 15, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.