|
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.
|