- NSIS Discussion
- Closing Explorer Shell!?
Archive: Closing Explorer Shell!?
resista
8th October 2002 15:32 UTC
Closing Explorer Shell!?
I want to close the explorer shell!
This doesnt seem to work(-:cry:-):
__________________________________________
FindWindow $R5 "" explorer
StrCmp $R5 0 explorernotrunning
SendMessage $R5 16 "" ""
__________________________________________
What should i do? :eek:
kichik
8th October 2002 17:39 UTC
You should search the forum and find:
http://forums.winamp.com/showthread....light=explorer
resista
8th October 2002 18:08 UTC
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
8th October 2002 18:15 UTC
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
8th October 2002 20:09 UTC
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
10th October 2002 21:13 UTC
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
11th October 2002 07:27 UTC
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
11th October 2002 12:12 UTC
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
11th October 2002 12:27 UTC
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
11th October 2002 12:28 UTC
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
11th October 2002 22:19 UTC
system solution
That's damn thing closed all the windows and disconnected me from inet. Sucks, but works...