From here:
Try
Process.Start(Path.Combine(Environment.GetEnvironmentVariable("windir"), "explorer.exe"));
It appears you must specify the full path to explorer to get the taskbar back.
Pergunta
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();
.
Solução
From here:
Try
Process.Start(Path.Combine(Environment.GetEnvironmentVariable("windir"), "explorer.exe"));
It appears you must specify the full path to explorer to get the taskbar back.
Outras dicas
From here:
Explorer must see some fulfilled conditions to launch as shell:
- Explorer must not run (which includes Control Panel, for instance)
- Explorer must see it is the actual shell - hence you need to replace that value before launching explorer.exe (could change it back a few seconds later)
- Sometimes it seems (on newer Windows versions) it depends on the process that launches explorer.exe - if it is "known" to explorer.exe -- I don't have any more details for this part though (and you couldn't change it, unfortunately)