469,945 Members | 1,802 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,945 developers. It's quick & easy.

A hard one.... - preventing Reboot

Anybody knows how to prevent a shutdown command? (on Win
XP).
Or just a way to let my application close itself rather
then being killed by the restart command.
I have been working in my organization on an application
that sometimes gets killed by an installation that
restarts the computer. I want to prevent this from
happening and display my own message box that asks for
reboot - or as i said, simply give my application time to
close itself.
Is there any way, a windows flag, anything at all that
can prevent shutdown command, or anything I can do in my
application that would respond to such a thing?
I tried to use the AbortSystemShutdownA() API but it
simply does not help since I have no way of knowing when
the shutdown will be executed and it would be stupid to
execute the AbortSystemShutdownA() function every
milisecond or so...

Anybody ? ...

Thanks,

Haim.
Jul 21 '05 #1
1 1421
Check out the SystemEvents.SessionEnding event and the other events this
class exposes.

/Joakim

Haim wrote:
Anybody knows how to prevent a shutdown command? (on Win
XP).
Or just a way to let my application close itself rather
then being killed by the restart command.
I have been working in my organization on an application
that sometimes gets killed by an installation that
restarts the computer. I want to prevent this from
happening and display my own message box that asks for
reboot - or as i said, simply give my application time to
close itself.
Is there any way, a windows flag, anything at all that
can prevent shutdown command, or anything I can do in my
application that would respond to such a thing?
I tried to use the AbortSystemShutdownA() API but it
simply does not help since I have no way of knowing when
the shutdown will be executed and it would be stupid to
execute the AbortSystemShutdownA() function every
milisecond or so...

Anybody ? ...

Thanks,

Haim.

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Adam Louis | last post: by
1 post views Thread by Haim | last post: by
2 posts views Thread by =?Utf-8?B?VHJhY2tz?= | last post: by
6 posts views Thread by =?Utf-8?B?YmxhY2tzaGVlcF83OTY=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.