On the Windows system taskbarQuick Start barThere is usually an icon. Click this icon to switch to the desktop. This icon is actually a "Windows Explorer command". Open this file in notepad and we can see the following content:
Mongoshelldeskcommand%2iconfile%%er.exe, 3 [taskbar] command = toggledesktop
The format of this file is actually an INI file. Here, we need to pay attention to the command = toggledesktop sentence, which is the command to be executed by explorer; with msdn, we can see instructions on toggledesktop:
This method has the same effect as the show desktop button in the quick launch area of the taskbar.
It either hides all open windows and shows the desktop, or it hides the desktop and shows all open windows.
The toggledesktop method does not display any user interface, it just invokes the toggle action.
In C #, to use the desktop display function, you actually use Shell. Application to execute the toggledesktop function,CodeAs follows:
type shelltype = type . gettypefromprogid ( "shell. application "); Object shellobject = system. activator . createinstance (shelltype); shelltype. invokemember ( "toggledesktop" , system. reflection. bindingflags . invokemethod, null , shellobject, null );