A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » Customizing Windows XP
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Customize "Logoff" button action



 
 
Thread Tools Display Modes
  #1  
Old May 6th 08, 09:11 AM posted to microsoft.public.windowsxp.customize
Sem Craeghs
external usenet poster
 
Posts: 2
Default Customize "Logoff" button action

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,
Ads
  #2  
Old May 7th 08, 12:36 AM posted to microsoft.public.windowsxp.customize
ju.c[_2_]
external usenet poster
 
Posts: 1,133
Default Customize "Logoff" button action

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


"Sem Craeghs" wrote in message
...
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,


  #3  
Old May 7th 08, 08:04 AM posted to microsoft.public.windowsxp.customize
Sem Craeghs
external usenet poster
 
Posts: 2
Default Customize "Logoff" button action

On 7 mei, 01:36, "ju.c" wrote:
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

"Sem Craeghs" wrote in message

...



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,- Tekst uit oorspronkelijk bericht niet weergeven -


- Tekst uit oorspronkelijk bericht weergeven -


Thanks,
but, is this supported by Microsoft?

Are there some alternatives?

With regards,
Sel
  #4  
Old May 8th 08, 12:06 AM posted to microsoft.public.windowsxp.customize
Bill
external usenet poster
 
Posts: 28
Default Customize "Logoff" button action



"Sem Craeghs" wrote in message
...
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,


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

  #5  
Old May 9th 08, 10:51 AM posted to microsoft.public.windowsxp.customize
ju.c[_2_]
external usenet poster
 
Posts: 1,133
Default Customize "Logoff" button action

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


"Sem Craeghs" wrote in message
...
On 7 mei, 01:36, "ju.c" wrote:
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

"Sem Craeghs" wrote in message

...



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,- Tekst uit oorspronkelijk bericht niet weergeven -


- Tekst uit oorspronkelijk bericht weergeven -


Thanks,
but, is this supported by Microsoft?

Are there some alternatives?

With regards,
Sel


  #6  
Old October 3rd 08, 03:01 AM posted to microsoft.public.windowsxp.customize
Mugwump
external usenet poster
 
Posts: 1
Default Customize "Logoff" button action


I also have the need for a user to Reboot when the Logoff button is
press or selected, what do I use to edit the .dll? I can see the some
info with ResHacker but not the "ExitWindowsEx(0, 0)" I am trying to do
this on a Xp Pro box. Thanks for the Help!


--
Mugwump
------------------------------------------------------------------------
Mugwump's Profile: http://forums.techarena.in/members/mugwump.htm
View this thread: http://forums.techarena.in/customize-xp/962680.htm

http://forums.techarena.in

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 10:09 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.