Microsoft KB Archive/137572

{|
 * width="100%"|

HOWTO: Restart the Windows Shell Programmatically

 * }

Q137572

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)

-

SUMMARY
Creating and updating shell extensions in Windows requires that the shell be restarted. This may be accomplished by having the user manually perform this task; however, in many cases, you may find it is better to do it programmatically.

MORE INFORMATION
To restart the shell programmatically, find the shell window, post it a quit message, and then call WinExec with explorer.exe. For Example:

  HWND hwndShell = FindWindow("Progman", NULL); PostMessage(hwndShell, WM_QUIT, 0, 0L); WinExec("Explorer.exe",SW_SHOW); Additional query words:

Keywords : kbLib kbOSWinNT kbOSWin2000 kbOSWin kbGrpDSShell

Issue type : kbhowto

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch