Today, some netizens asked how to display and hide the taskbar?
Here, I will publish a method to display and hide Windows taskbar using Windows API. The Windows taskbar is actually a window, as long as I find the handle of this window, it is easy to show and hide. the taskbar is a window without a title, but its class name isShell_traywndTherefore, you can use findwindow or findwindowex to find its handle, and show and hide the window, using showwindow:
- Introduction of Windows API Declaration
[Dllimport ("user32.dll", entrypoint = "find1_wex", setlasterror = true)] Static extern intptr find1_wex (intptr hwndparent, intptr success, string lpszclass, string lpszwindow ); [dllimport ("user32.dll", entrypoint = "showwindow", setlasterror = true)] Static extern bool showwindow (intptr hwnd, uint ncmdshow );
- Display/hide the taskbar window
Intptr trayhwnd = find1_wex (intptr. Zero, intptr. Zero, "shell_traywnd", null); If (trayhwnd! = Intptr. Zero) {showwindow (trayhwnd, 0 );}
In the code above, the second parameter of showwindow,1Display,0Hide