473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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 1534
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
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
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
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
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
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
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
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.