Skip to content
⌘ NSIS Forum Archive

Closing Explorer Shell!?

11 posts

resista#

Closing Explorer Shell!?

I want to close the explorer shell!
This doesnt seem to work(-😢-):


__________________________________________

FindWindow $R5 "" explorer
StrCmp $R5 0 explorernotrunning
SendMessage $R5 16 "" ""

__________________________________________

What should i do? 😱
kichik#
You should search the forum and find:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
resista#
I have read that. but it doesnt solve my problem...

i need the class name of the explorer shell...
and since it doesnt really have a window i cont get it with win32spy!

How should i do?

the class name of the tray is Shell_TrayWnd so this could work:

______________________________________

FindWindow $R5 Shell_TrayWnd
______________________________________

and it sorta does, but then i get the Shut Down menu..

is there any way of getting round this?
a kill command or other way to force it to close?
kichik#
Shell_TrayWnd is the class of the tray bar...

Killing Explorer is never a good idea. There is almost always a better way of doing whatever it is you are trying to do, and if there isn't a restart or logoff/on would be a lot better than killing Explorer.

If you tell me what exactly you are trying to do I might be able to help you a little better.
resista#
I really have to close explorer since im building a shellswicher for litestep...

so, when running the program it determines if explorer is running and if it is it should shutdown explorer and start litestep!

so i have to close explorer!
kichik#
Well,

Killing Explorer is never a good idea. There is almost always a better way of doing whatever it is you are trying to do, and if there isn't a restart or logoff/on would be a lot better than killing Explorer.
AFAIK there is no clean way of restarting explorer other than a logoff-logon or a reboot.
resista#
How do i do to logoff/on?

I searched the forum and the help files but i couldnt find anything about a 'logoff' command. Is there one? Or is there any other way to logoff, like displaying the shutdown menu or something?

Sorry if im a pain in the ass🙂
kichik#
You will have to create an extension DLL to do this.
Just have the DLL function call ExitWindowsEx(EWX_LOGOFF, 0);
I suggest you only call this DLL function if the user agrees. You can also call ExitWindowsEx with system.dll but I haven't really tried it yet so you will have to ask brainsucker about its usage.
resista#
i dont have the knowledge required to make an extension dll... 🙁
you think that someone has already made an extension like that?

or do yoy know of someone hwo just loves making extension dlls for otherpeople?

I think that a logoff/of command is something that should be included...
kichik#
You can also call ExitWindowsEx with system.dll but I haven't really tried it yet so you will have to ask brainsucker about its usage.
😉
brainsucker#
system solution

That's damn thing closed all the windows and disconnected me from inet. Sucks, but works...