Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows VistaWindows XPWindows MeWindows 98Windows 95Virtual PCInternet ExplorerOutlook ExpressWindows MediaSecurity
Related Topics
MS Server ProductsMS OfficePC HardwareMore Topics ...

Windows Forum / Windows XP / Customization / October 2008

Tip: Looking for answers? Try searching our database.

Customize "Logoff" button action

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sem Craeghs - 06 May 2008 09:11 GMT
Hey,

I've looked all over the internet for about 2,5 days, but no succesful
answer:

Is there any possible way to change the action behind the "Logoff"
button?

We have to do this because we are serving serveral virtual windows XP
desktops;

Users connect to the desktop using RDP, so, there is the "Shut down"
button not available.

We want, when a user logs off the virtual machine, that the machine
logs off and restart again. (to remove changes to the drive using
Steady State).

We have tried to do this with a logoff script, but that is not working
(the shutdown -r -t 00 process is killed by the logoff process.)

Thanks,
ju.c - 07 May 2008 00:36 GMT
The commands are hard coded inside
\WINDOWS\System32\user32.dll

To change the action when pressing the Log Off button you need to find
the code inside of user32.dll and change it.

ExitWindowsEx(int uFlags, int dwReason)

Log Off: ExitWindowsEx(0, 0)
Log Off: ExitWindowsEx(4, 0)  (force processes to terminate while
logging off)
Reboot: ExitWindowsEx(2, 0)
Shutdown: ExitWindowsEx(1, 0)

This is a fun challenge, if you need more info tell me where to start.
Do you know how to mod a dll, etc.?

ju.c

> Hey,
>
[quoted text clipped - 18 lines]
>
> Thanks,
Sem Craeghs - 07 May 2008 08:04 GMT
> The commands are hard coded inside
> \WINDOWS\System32\user32.dll
[quoted text clipped - 39 lines]
>
> - Tekst uit oorspronkelijk bericht weergeven -

Thanks,
but, is this supported by Microsoft?

Are there some alternatives?

With regards,
Sel
ju.c - 09 May 2008 10:51 GMT
>>is this supported by Microsoft?

Of course not.

>> Are there some alternatives?

Good luck!

Modding the dll is the easiest way.

Just change  ExitWindowsEx(0, 0)  to  ExitWindowsEx(2, 0)

ju.c

>> The commands are hard coded inside
>> \WINDOWS\System32\user32.dll
[quoted text clipped - 53 lines]
> With regards,
> Sel
Mugwump - 03 Oct 2008 03:01 GMT
I also have the need for a user to Reboot when the Logoff button i
press or selected, what do I use to edit the .dll? I can see the som
info with ResHacker but not the "ExitWindowsEx(0, 0)"  I am trying to d
this on a Xp Pro box.  Thanks for the Help

--
Mugwum

http://forums.techarena.i
Bill - 08 May 2008 00:06 GMT
> Hey,
>
[quoted text clipped - 18 lines]
>
> Thanks,

You could create a shortcut on the desktop to the shutdown.exe file and
modify the paramaters used in the target box on the general properties page
of the shortcut. I used to use this trick to force an older machine I had
installed XP on to shutdown at a specified time. HTH
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.