- Customize "Logoff" button action
- Posted by Sem Craeghs on May 6th, 2008
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,
- Posted by ju.c on May 6th, 2008
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" <sem.craeghs@gmail.com> wrote in message
news:c22f2680-b432-45a5-8fd9-d983b4ba9d4a@b64g2000hsa.googlegroups.com...
- Posted by Sem Craeghs on May 7th, 2008
On 7 mei, 01:36, "ju.c" <bibidybubidyb...@mailnator.com> wrote:
Thanks,
but, is this supported by Microsoft?
Are there some alternatives?
With regards,
Sel
- Posted by Bill on May 7th, 2008
"Sem Craeghs" <sem.craeghs@gmail.com> wrote in message
news:c22f2680-b432-45a5-8fd9-d983b4ba9d4a@b64g2000hsa.googlegroups.com...
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
- Posted by ju.c on May 9th, 2008
Of course not.
Good luck!
Modding the dll is the easiest way.
Just change ExitWindowsEx(0, 0) to ExitWindowsEx(2, 0)
ju.c
"Sem Craeghs" <sem.craeghs@gmail.com> wrote in message
news:f3f15e41-7a5b-463e-b35a-ad0c8c7eb2eb@b64g2000hsa.googlegroups.com...