Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.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# 在Windows7/Vista中启动“PC预订”应用程序的最佳方法?_C#_Shell_Windows 7_Explorer_Winlogon - Fatal编程技术网

C# 在Windows7/Vista中启动“PC预订”应用程序的最佳方法?

C# 在Windows7/Vista中启动“PC预订”应用程序的最佳方法?,c#,shell,windows-7,explorer,winlogon,C#,Shell,Windows 7,Explorer,Winlogon,我正在用C编写一种PC预订应用程序客户端,除了用户登录到PC Windows 7/Vista时,我无法尽快启动它,即我想以某种方式覆盖explorer.exe 我已尝试在中用explorer.exe替换我的应用程序 “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell” 它可以工作,但当我尝试在我的应用程序中启动explorer.exe时 const string explorer = "explorer.exe";

我正在用C编写一种PC预订应用程序客户端,除了用户登录到PC Windows 7/Vista时,我无法尽快启动它,即我想以某种方式覆盖explorer.exe

我已尝试在中用explorer.exe替换我的应用程序

“HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell”

它可以工作,但当我尝试在我的应用程序中启动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();
它只是挂起,不能像应该的那样启动资源管理器

我还尝试了许多其他解决方法,根据

但在Windows7/Vista中,似乎没有一个能100%工作。在XP中,它似乎工作得更好

顺便说一句:UAC在所有运行此功能的机器上都已关闭

任何建议都很好-现在我被卡住了


谢谢

不要进行eProcess.WaitForInput;,那时它就可以工作了。

我没有时间玩游戏并提供真正的答案,但UseShellExecute设置在我看来是错误的-shell通常是explorer,但在您的情况下除外,我猜是您的程序,它还没有运行,所以它不可能自动启动。你试过把它设成假的吗?你好,陶。是的-我也考虑过这一点,并尝试将UseShellExecute设置为false。我现在确实有一个浏览器窗口,但没有外壳,没有任务栏等等。如果我将[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\explorer\Advanced]SeparateProcess设置为1,它似乎也能工作。在注册表中进行黑客攻击是一个非常糟糕的主意,你的应用程序之所以挂起是因为我上面提到的调用,我很确定explorer.exe永远不会达到某个特定条件。无论如何,为什么你的应用程序必须在浏览器之前启动?我敢肯定在窗户上乱搞是件危险的事。。。第一个资源管理器实例比你想象的要多得多,改变它在Windows中的启动方式不是一个好主意。SpikeX是一个PCBooking应用程序,在我锁定键盘、禁用CAD、taskmanager等之前,用户不应该启动任何东西。这就是这个应用的全部想法。啊,我明白了,只是好奇而已。那样的话,是的,那可能是最好的路线不,它不是我想要的。我有一个浏览器窗口,但没有外壳,没有任务栏,桌面等等。我必须尝试另一种方法。