Address: http://www.zu14.cn/2009/03/13/csharp-show-hide-taskbar-by-api/
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 the 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 ="Finddomainwex", Setlasterror =True)]
Static externIntptrFinddomainwex (IntptrHwndparent,IntptrHwndchildafter,StringLpszclass,StringLpszwindow );
[Dllimport("User32.dll", Entrypoint ="Showwindow", Setlasterror =True)]
Static extern boolShowwindow (IntptrHwnd,UintNcmdshow );
- Display/hide the taskbar window
//IntptrTrayhwnd = find1_wex (Intptr. Zero,Intptr. Zero,"Shell_traywnd",Null);
IntptrTrayhwnd = findwindow ("Shell_traywnd",Null);
If(Trayhwnd! =Intptr. Zero)
{
Showwindow (trayhwnd, 0 );
}
The aboveCode, The second parameter of showwindow,1Display,0Hide
Address: http://www.zu14.cn/2009/03/13/csharp-show-hide-taskbar-by-api/
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 the 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 ="Finddomainwex", Setlasterror =True)]
Static externIntptrFinddomainwex (IntptrHwndparent,IntptrHwndchildafter,StringLpszclass,StringLpszwindow );
[Dllimport("User32.dll", Entrypoint ="Showwindow", Setlasterror =True)]
Static extern boolShowwindow (IntptrHwnd,UintNcmdshow );
- Display/hide the taskbar window
//IntptrTrayhwnd = find1_wex (Intptr. Zero,Intptr. Zero,"Shell_traywnd",Null);
IntptrTrayhwnd = findwindow ("Shell_traywnd",Null);
If(Trayhwnd! =Intptr. Zero)
{
Showwindow (trayhwnd, 0 );
}
in the above Code, the second parameter of showwindow, 1 indicates display, and 0 indicates hiding