Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 10-15-2009, 00:40
nino nino is offline
Friend
 
Join Date: Jan 2002
Posts: 58
Rept. Given: 0
Rept. Rcvd 2 Times in 1 Post
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
nino Reputation: 2
Git,

Thanks for your reply. This is taken from the MSDN documentation regarding ExitWindowsEx:

The function is designed to stop all processes in the caller's logon session. Therefore, if you are not the interactive user, the function can succeed without actually shutting down the computer. If you are not the interactive user, use the InitiateSystemShutdown or InitiateSystemShutdownEx function.

As you can see, it is better to use InitiateSystemShutdown. However this displays the System Shutdown dialog I can't subclass. In fact, reversing the shutdown.exe utility you can see that it uses this latter API. But what you propose is valid. I can write my own shutdown utility with my own Dialog and call the same API shutdown does. However reversing shutdown will take longer than just subclassing the Dialog. So, unless this Dialog can't be subclassed y prefer not to reverse.
Reply With Quote
  #2  
Old 10-16-2009, 12:16
bilbo bilbo is offline
Friend
 
Join Date: Jul 2004
Posts: 103
Rept. Given: 36
Rept. Rcvd 15 Times in 12 Posts
Thanks Given: 15
Thanks Rcvd at 17 Times in 11 Posts
bilbo Reputation: 15
You can use SHUTDOWN replacement by sysinternals.com: look for PSSHUTDOWN.
The option '-c' adds the "Cancel" button to the shutdown dialog box.

Best regards, bilbo
Reply With Quote
  #3  
Old 10-17-2009, 10:18
nino nino is offline
Friend
 
Join Date: Jan 2002
Posts: 58
Rept. Given: 0
Rept. Rcvd 2 Times in 1 Post
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
nino Reputation: 2
Hey Bilbo, this is exactly what I needed. I already created a little proggie that allows to cancel shutdown from the tray and it works fine but I might be curious and look inside this utility to see how it bypasses the System Shutdown dialog.
Thanks a lot!!
Reply With Quote
Reply

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Skillfeed everything for free // site shutdown Spiderz_Soft General Discussion 2 09-22-2015 01:06


All times are GMT +8. The time now is 02:14.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )