Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何阻止Windows Explorer和Internet Explorer自动重新启动?_C#_Windows - Fatal编程技术网

C# 如何阻止Windows Explorer和Internet Explorer自动重新启动?

C# 如何阻止Windows Explorer和Internet Explorer自动重新启动?,c#,windows,C#,Windows,我有一个程序,需要访问Windows Explorer和Internet Explorer使用的一些文件。我找到的唯一方法是关闭Explorer和IE进程——但是Proc.Kill和RestartManager-RmShutdown只在瞬间关闭它们——然后,它们重新启动。我找到了一个解决方法:我使用cmd-taskkill/im-但这真的很难看。有没有更好的办法关闭它们 BOOL ExitExplorer() { HWND hWndTray = FindWindow(_T("Shell_

我有一个程序,需要访问Windows Explorer和Internet Explorer使用的一些文件。我找到的唯一方法是关闭Explorer和IE进程——但是Proc.Kill和RestartManager-RmShutdown只在瞬间关闭它们——然后,它们重新启动。我找到了一个解决方法:我使用cmd-taskkill/im-但这真的很难看。有没有更好的办法关闭它们

BOOL ExitExplorer()
{
    HWND hWndTray = FindWindow(_T("Shell_TrayWnd"), NULL);
    return PostMessage(hWndTray, 0x5B4, 0, 0);
}
这是优雅地退出资源管理器的代码:
在这里的StackOveflow上找到的。

我可以问一下您试图访问的内容和目的吗?您需要修改系统文件吗?所以写病毒?别紧张@jb他不是在写病毒。他只是在写一封借壳信。。特洛伊人!!不,不是病毒:-我正在删除ATI的视频驱动程序残留物-出于某种原因,Explorer和IE都在访问它的文件HWA?。问题是,即使在我停止Aero服务UxSms后,explorer仍然打开了一些ATI文件的句柄。当然,关闭explorer一段时间是可能的,因为我见过安装人员这样做。不幸的是,我不知道怎么做。下次发生这种情况时,我会尽量记住让你知道它是哪个软件,如果它是开源的,你可以看看他们在做什么。