View Full Version : Windows Logoff
hollyfnet
07-11-2000, 10:55 AM
Does anyone out there know how to create a shortcut to log off the current user WITHOUT having the desktop update installed? (rundll.exe shell32.dll,SHExitWindowsEx only works if you have the desktop update installed)
Thanks
reghakr
07-11-2000, 11:26 AM
Are you sure about that?. Here are the options for SHExitWindowsEx
Using the User.exe & User32.dll Exit Windows functions doesn't allow any control over what type of shutdown is preformed as parameters aren't passed, they operate as if 0 is passed - which is shutdown for ExitWindows and Logoff for ExitWindowsEx. An undocumented function SHExitWindowsEx in Shell32.dll which is what Explorer seems to use does take parameters.
rundll32.exe shell32.dll,SHExitWindowsEx [optional number in hex]
Action Value in Hex
EWX_LOGOFF 0
EWX_SHUTDOWN 1
EWX_REBOOT 2
EWX_FORCE 4
EWX_POWEROFF for machines that turn off their own power 8
These values can be added together, eg, 5 is shutdown and force applications to close and an implicit logoff.
Note their is no Restart without rebooting. This requires a parameter of 42 (hex) to be passed to ExitWindows in User.exe. This can't be done from the command line
reghakr
hollyfnet
07-11-2000, 01:34 PM
Thanks for the reply. I have tried using the shell32.dll,SHExitWindowsEx 0/2/5 on windows95 machines that have just had windows installed and it says "error in shell32.dll missing entry,SHExitWindowsEx" but it I install the desktop update, it works (and uses a completely different shell32.dll file) but if I remove desktop update, it changes the shell32.dll file and doesn't work anymore. (size of shell32.dll with update is 1,400,832 bytes, without is 819,200 bytes. I have tried copying the shell32.dll file with desktop update over the one on the 'clean' windows 95 machines, but that went quite wrong...) I also tried using user32.dll,ExitWindowsEx but that logs off, and comes up with an error from rundll32 saying the usual windows error (this program has performed an illegal operation and will be shut down). It also doesn't always log off properly, it leaves the desktop visable but puts a logon screen in the middle. Any ideas why? I just need it to logoff, not shutdown reboot or any of the others.
Thanks
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.