7

As of right now, I am working on a mock up OS via WinForms to use as a prop for movies. Upon running the application, it kills explorer.exe so that you can't accidentally have the windows task bar show up during a shoot. The issue is, upon closing the mock OS I would like for explorer.exe to be started up again. However, Process.Start("explorer.exe"); brings up an explorer window, and does not re-instate the window taskbar.

I know for a fact, that task manager is more than capable of bringing back the window taskbar via typing "explorer.exe" under a new task, though I've had no luck finding command line arguments to pass to task manager.

Edit: I'm running under Windows 7. As well, I'm going pretty in depth with this mock OS. I'm taking control of quite a few key presses that Windows uses. For this reason, I kill explorer.exe so that I can use key presses such as "Alt-Tab" and display a mock app switcher, etc. The app already runs in full screen, but it is still possible to have the underlying Windows GUI pop back up. I am essentially replacing explorer.exe with my own mock up explorer. Upon closing my custom explorer, I can't seem to get the regular Windows GUI to come back by launching explorer.exe via Process.Start();.

4

2 回答 2

14

这里

尝试

Process.Start(Path.Combine(Environment.GetEnvironmentVariable("windir"), "explorer.exe"));

看来您必须指定资源管理器的完整路径才能恢复任务栏。

于 2013-08-15T21:23:54.063 回答
0

这里

Explorer 必须看到一些满足的条件才能作为 shell 启动:

  1. 资源管理器不得运行(例如,包括控制面板)
  2. Explorer 必须看到它是实际的 shell - 因此您需要在启动 explorer.exe 之前替换该值(可以在几秒钟后将其更改回来)
  3. 有时它似乎(在较新的 Windows 版本上)取决于启动 explorer.exe 的进程——如果它是 explorer.exe “已知”的——虽然我没有这部分的更多细节(你不能不幸的是,改变它)
于 2019-03-03T14:39:44.140 回答