Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个程序,它需要访问 Windows Explorer 和 Internet Explorer 使用的一些文件。我发现的唯一方法是关闭资源管理器和 IE 进程 - 但 Proc.Kill() 和 RestartManager - RmShutdown() 只关闭它们一瞬间 - 然后它们重新启动。我找到了一种解决方法:我正在使用 cmd - taskkill /im - 但这真的很难看。有更好的方法来关闭它们吗?
BOOL ExitExplorer() { HWND hWndTray = FindWindow(_T("Shell_TrayWnd"), NULL); return PostMessage(hWndTray, 0x5B4, 0, 0); }
这是优雅退出 Explorer 的代码 :) 在 StackOveflow 上找到它。