0

我正在编写一种 PC 预订应用程序(C# 中的客户端),除了当用户登录 PC(Windows 7 / Vista)时我有问题尽快启动它之外,一切都完成了,即我想以某种方式覆盖 explorer.exe。

我试图用 explorer.exe 替换我的应用程序,

“HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell”</p>

它可以工作,但是当我尝试在我的应用程序中启动 explorer.exe 时,

const string explorer = "explorer.exe";
string explorerPath = string.Format("{0}\\{1}", Environment.GetEnvironmentVariable("WINDIR"), explorer);
Process eProcess = new Process();
eProcess.StartInfo.FileName = explorerPath;
eProcess.StartInfo.UseShellExecute = true;
eProcess.StartInfo.CreateNoWindow = true;
eProcess.Start();
eProcess.WaitForInputIdle();

它只是挂起并且没有按应有的方式启动资源管理器。

我还尝试了许多其他“解决方法”,根据不同的注册表项开始,

http://technet.microsoft.com/en-us/magazine/ee851671.aspx

但似乎没有一个在 Windows 7 / Vista 中可以 100% 工作。在 XP 中它似乎工作得更好。

顺便说一句:UAC 在所有将要运行的机器上都关闭。

任何建议都会很好 - 现在我被困住了。

谢谢。

4

1 回答 1

0

不要eProcess.WaitForInputIdle();,那样就可以了。

于 2012-03-07T14:13:05.150 回答