chasetoys
24th July 2006 03:27 UTC
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
Afrow UK
24th July 2006 11:27 UTC
I'll see what I can do with some C++
-Stu
Afrow UK
24th July 2006 12:01 UTC
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
Takhir
24th July 2006 13:29 UTC
On my XP class is ExploreWClass
The same on 2003. And script works correct :)
CabinetWClass is MyComputer window class.
Afrow UK
24th July 2006 13:36 UTC
I tried ExploreWClass but it doesn't work. For me (XP) EnumWindows and RealGetWindowClass returned CabinetWClass.
-Stu
galil
24th July 2006 13:40 UTC
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.
Afrow UK
24th July 2006 13:42 UTC
Just use the code twice with both class names :)
-Stu
chasetoys
27th July 2006 06:04 UTC
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