User Tools

Site Tools


Command disabled: register
controlling_20the_20windows_20taskbar

Controlling the Windows taskbar

by Richard Russell, August 2007

The code listed in this article allows you to control various aspects of the Windows taskbar, in particular to hide and show the deskband, notification icons and clock:



In the normal configuration, the deskband is positioned on the left, next to the Start button, and holds shortcuts to popular applications; the clock is at the extreme right-hand end of the taskbar, and to the left of the clock are the notification icons. Listed below are code segments to hide and show the taskbar itself and each of these elements:

To hide the taskbar:

        SYS "FindWindow", "Shell_TrayWnd", 0 TO htray%
        SYS "ShowWindow", htray%, 0

To show the taskbar:

        SYS "FindWindow", "Shell_TrayWnd", 0 TO htray%
        SYS "ShowWindow", htray%, 1

To hide the deskband:

        WMTRAY_TOGGLEQL = &4ED
        SYS "FindWindow", "Shell_TrayWnd", 0 TO htray%
        SYS "SendMessage", htray%, WMTRAY_TOGGLEQL, 0, 0 : REM Hide deskband

To show the deskband:

        WMTRAY_TOGGLEQL = &4ED
        SYS "FindWindow", "Shell_TrayWnd", 0 TO htray%
        SYS "SendMessage", htray%, WMTRAY_TOGGLEQL, 0, 1 : REM Show deskband

To hide the notification icons:

        SYS "FindWindow", "Shell_TrayWnd", 0 TO htray%
        SYS "FindWindowEx", htray%, 0, "TrayNotifyWnd", 0 TO hnotify%
        SYS "FindWindowEx", hnotify%, 0, "SysPager", 0 TO hpager%
        SYS "ShowWindow", hpager%, 0 : REM Hide systray icons

To show the notification icons:

        SYS "FindWindow", "Shell_TrayWnd", 0 TO htray%
        SYS "FindWindowEx", htray%, 0, "TrayNotifyWnd", 0 TO hnotify%
        SYS "FindWindowEx", hnotify%, 0, "SysPager", 0 TO hpager%
        SYS "ShowWindow", hpager%, 1 : REM Show systray icons

To hide the clock:

        SYS "FindWindow", "Shell_TrayWnd", 0 TO htray%
        SYS "FindWindowEx", htray%, 0, "TrayNotifyWnd", 0 TO hnotify%
        SYS "FindWindowEx", hnotify%, 0, "TrayClockWClass", 0 TO hclock%
        SYS "ShowWindow", hclock%, 0 : REM Hide systray clock

To show the clock:

        SYS "FindWindow", "Shell_TrayWnd", 0 TO htray%
        SYS "FindWindowEx", htray%, 0, "TrayNotifyWnd", 0 TO hnotify%
        SYS "FindWindowEx", hnotify%, 0, "TrayClockWClass", 0 TO hclock%
        SYS "ShowWindow", hclock%, 1 : REM Show systray clock

Note that this code isn't guaranteed to work in all circumstances and on all versions of Windows. In particular some applications are believed to force the notification icons to display even if you have hidden them. You should check that the code meets your specific requirements before using it.

This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
controlling_20the_20windows_20taskbar.txt · Last modified: 2018/04/16 14:45 by richardrussell