Anthony Wieser
2004-10-22 06:43:09 UTC
I'm trying to programmatically restart Explorer, and have found the
following snippet on MSDN (Q137572)
HWND hwndShell = FindWindow("Progman", NULL);
PostMessage(hwndShell, WM_QUIT, 0, 0L);
WinExec("Explorer.exe",SW_SHOW);
I've also found this as a way to shut down the shell:
Press CTRL+ALT+SHIFT, and click No in the Shut Down Windows dialog box.
On Windows 2000,
click Cancel instead of No. The Shell is now shut down, but all other
applications are still running,
including the debugger.
Then in task manager, run explorer.exe
My question is:
When I use the first way, everything in the Run keys of the registry and the
start menu are executed again, while using the second method, this does not
happen. Does anybody know what is happening in the second method that
prevents the running of the auto run entries? Is there any way to mimic the
behaviour in my program?
Anthony Wieser
Wieser Software Ltd
following snippet on MSDN (Q137572)
HWND hwndShell = FindWindow("Progman", NULL);
PostMessage(hwndShell, WM_QUIT, 0, 0L);
WinExec("Explorer.exe",SW_SHOW);
I've also found this as a way to shut down the shell:
Press CTRL+ALT+SHIFT, and click No in the Shut Down Windows dialog box.
On Windows 2000,
click Cancel instead of No. The Shell is now shut down, but all other
applications are still running,
including the debugger.
Then in task manager, run explorer.exe
My question is:
When I use the first way, everything in the Run keys of the registry and the
start menu are executed again, while using the second method, this does not
happen. Does anybody know what is happening in the second method that
prevents the running of the auto run entries? Is there any way to mimic the
behaviour in my program?
Anthony Wieser
Wieser Software Ltd