473,508 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1536
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4922
by: q2face | last post by:
Dear group: I have removed my hard drive from my laptop (which is now toast) and have managed to recover nearly all the data from it by installing the drive into my desktop. I was hoping to...
8
6430
by: Adam Louis | last post by:
I would like help resolving this problem. I'm a novice who's been hired to query a hospital database and extract useful information, available to me only in a dynamically generated, downloadable...
1
239
by: Haim | last post by:
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...
1
1562
by: Aaron | last post by:
Not sure if this is the best spot to post this question, but I am not going to pay money to ask an installation question.... Anyways I am trying to install C# standard 2003 and it analyzes the...
14
2441
by: google | last post by:
I am creating a new database for use within our company, that I'd like to make reasonably secure (short of a true server based solution). The back-end of a non-server based database seems to be...
3
4001
by: iamsiju | last post by:
Hi, I am facing a problem with the Perl Telnet Object. My Telnet Object hangs just after issueing reboot command on the remote host. Please help me who faced this problem !!! Thanks in...
2
4683
by: =?Utf-8?B?VHJhY2tz?= | last post by:
When I run my setup of a vb.net app made in VS2005 and setup made with the setup wizard and then modified in the ide, The .net 2 setup runs and installs and then asks to reboot. If you answer ok...
6
1369
by: =?Utf-8?B?YmxhY2tzaGVlcF83OTY=?= | last post by:
Hello All, I have a 16 GB Solid State Hard Drive and for some reason after a couple of weeks when I reboot it goes to a blinking cursor in the top left corner or sometimes it will give an error...
3
1688
by: cj | last post by:
My program shuts itself down and reboots the pc it's running on at 2:00am twice a week and has been doing so without fail for over a year. But twice in the past month it's been found running in the...
0
7226
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7125
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7049
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5631
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3199
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1561
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
422
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.