How to toggle/switch Windows taskbar from “show” to “auto-hide” (and vice-versa)?

后端 未结 7 2226
忘掉有多难
忘掉有多难 2021-02-15 14:58

Basically I want to make simple toggle program (that will be mapped to some keyboard shortcut) that set taskbar to auto-hide mode if in normal mode (and conversely, to normal sh

7条回答
  •  臣服心动
    2021-02-15 15:06

    For all those who arrived here from Google and are using Windows 10, like me, the answers from @Quispie and @nicruo are OK but need an extra if.

    The reason for that is the class name differs from version to version (apparently, as I no longer have any other Windows but 10).

    msgData.hWnd = FindWindow("System_TrayWnd", null);
    if (msgData.hWnd == IntPtr.Zero)
        msgData.hWnd = FindWindow("Shell_TrayWnd", null);
    

提交回复
热议问题