1 Public Static classWintask2 {3 Private Const intSw_hide =0;//API parameters represent hidden Windows4 Private Const intSw_show =5;//The API parameter indicates that the window is displayed with the current size and position5 6[DllImport ("user32.dll")]7 Private Static extern intFindWindow (stringClassName,stringwindowname);8[DllImport ("user32.dll")]9 Private Static extern intShowWindow (intHandleintcmdshow);Ten /// <summary> One ///Show A /// </summary> - Public Static voidShowtaskbar () - { theShowWindow (FindWindow ("Shell_traywnd",NULL), sw_show); - } - /// <summary> - ///Hidden + /// </summary> - Public Static voidHidetaskbar () + { AShowWindow (FindWindow ("Shell_traywnd",NULL), sw_hide); at } -}View Code
After this, the taskbar is hidden, but the start button is still there, the solution is to set the taskbar to automatically hide it.
Show and hide the system tray class