// 通过向系统发送消息,可以完成一些系统任务。
HWND hWnd = ::FindWindow(_T("Shell_TrayWnd"), NULL);
if (hWnd != NULL)
{
// 显示桌面
::PostMessage(hWnd, WM_COMMAND, MAKELONG(407, 0), NULL);
}
具体的消息如下:
Serial. | Msg Number | Description Of The Message |
1. | 305 | Displays the Start menu |
2. | 401 | Displays Run Dialog |
3. | 402 | Displays Logoff Dialog |
4. | 403 | Command to cascade all toplevel windows |
5. | 404 | Command to Tile Horizontally all top level windows |
6. | 405 | Command to Tile Vertically all top level windows |
7. | 407 | Shows the desktop. Do look at message number 419. |
8. | 408 | Shows the Date and Time Dialog |
9. | 413 | Shows taskbar properties |
10. | 415 | Minimize all windows |
11. | 416 | Maximize all windows. To see the effect of this command first do Minimize and then Maximize all. |
12. | 419 | Well I am a bit confused about this message. This also shows the desktop. Maybe somebody can notice the difference. |
13. | 420 | Shows task manager |
14. | 421 | Opens Customize Taskbar Dialog |
15. | 424 | Locks the taskbar |
16. | 503 | Opens Help and Support Center Dialog |
17. | 505 | Opens Control panel |
18. | 506 | Shows the Shutdown computer dialog |
19. | 510 | Displays the Printers and Faxes dialog |
20. | 41093 | Displays Find Files Dialog |
21. | 41094 | Displays Find Computers Dialog |