Archive: Closing all explorer windows (not explorer.exe itself)


Closing all explorer windows (not explorer.exe itself)
Hey folks:

I'm using NSIS, and I have the exact same problem as covered in the following forum link. That is, I want to close down all explorer.exe windows, though not explorer.exe itself.

Here's the link:

http://forums.winamp.com/showthread....+windows+close

Here's the code (which I tried, and no explorer windows are closed... ideas?):

!Include WinMessages.NSH
Name ""
OutFile "exrunning.exe"
Section "Explorer running?"
FindWindow $R0 ExploreWClass
IsWindow $R0 ExRunning
Abort
ExRunning:
MessageBox MB_OK "ex running"
SendMessage $R0 ${WM_SYSCOMMAND} 0xF060 0
SectionEnd


I'll see what I can do with some C++

-Stu


You got the class name wrong. kichik even said in that topic what the class name is.


FindWindow $R0 CabinetWClass
IsWindow $R0 0 +3
SendMessage $R0 ${WM_SYSCOMMAND} 0xF060 0
Goto -3

This will close all Windows Explorer windows.

-Stu

On my XP class is ExploreWClass
The same on 2003. And script works correct :)
CabinetWClass is MyComputer window class.


I tried ExploreWClass but it doesn't work. For me (XP) EnumWindows and RealGetWindowClass returned CabinetWClass.

-Stu


If you open explorer using Start>Programs or [WinKey]+E then you get the ExploreWClass class (Has Folder Tree View on by default)

If the opened explorer window doesn't have Tree View, the class is CabinetWClass.

So the script should be checking both.


Just use the code twice with both class names :)

-Stu


Thank you to everyone!!

This works great, and writes my dll & registers it without a hitch, and works great for uninstallation too!

I'm very happy with NSIS, and moreover, the great community here :).

-chasetoys