Gracefully Exit Explorer (Programmatically)
问题 How do you gracefully close Explorer programmatically? By that I mean, how do you invoke this function programmatically: Edit: Typo in the picture, it should say "Ctrl-Shift-Right-Click" instead of "Shift-Click". 回答1: I debugged this out of curiosity. All it does is post a message to one of explorer's windows: BOOL ExitExplorer() { HWND hWndTray = FindWindow(_T("Shell_TrayWnd"), NULL); return PostMessage(hWndTray, 0x5B4, 0, 0); } Of course this is an undocumented WM_USER message so the