473,399 Members | 2,146 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,399 software developers and data experts.

How do I Abort/Delayed Shutdown

My app sits quitely on the system tray of a file serve, monitoring some
users' predefined files.

How can I trap the system shutdown message and display a warning.
User should be allow to abort the system shutdown/restart.

As long as those files are opened by somebody (be it locally or remotely),
my apps should gives warning.
Thank You,
mfwoo
Nov 21 '05 #1
4 2178
Form_QueryUnload event of the form has UnloadMode param which has
different states....and you can detect the windows shutting mode also.

Shivprasad Koirala
C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
http://www.geocities.com/dotnetinterviews/

Nov 21 '05 #2
Pardon my ignorance.
But I'd go through the events from the VS2003 IDE and I can't get
Form_QueryUnload events.
Thank You,
mfwoo

"sh**********@yahoo.com" wrote:
Form_QueryUnload event of the form has UnloadMode param which has
different states....and you can detect the windows shutting mode also.

Shivprasad Koirala
C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
http://www.geocities.com/dotnetinterviews/

Nov 21 '05 #3
Hi,

It is the closing event now.

Ken
------------------------
"Woo Mun Foong" <mf***@yahoo.com> wrote in message
news:08**********************************@microsof t.com...
Pardon my ignorance.
But I'd go through the events from the VS2003 IDE and I can't get
Form_QueryUnload events.
Thank You,
mfwoo

"sh**********@yahoo.com" wrote:
Form_QueryUnload event of the form has UnloadMode param which has
different states....and you can detect the windows shutting mode also.

Shivprasad Koirala
C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
http://www.geocities.com/dotnetinterviews/

Nov 21 '05 #4
Hi,

Thanks a lot both of you.
Get it working correctly now.

However, I stil have a tiny little problem.
My apps will get iconized on window startup. If I shutdown windows now,
WM_QUERYENDSESSION doesn't get captured.
But, when I restore the apps to normal size and iconized it back, only then
WM_QUERYENDSESSION will get captured.

In short, the apps needs to get focus once, before it can capture
WM_QUERYENDSESSION.

Any ideas?

Thanks,
mfwoo

"Ken Tucker [MVP]" wrote:
Hi,

It is the closing event now.

Ken
------------------------
"Woo Mun Foong" <mf***@yahoo.com> wrote in message
news:08**********************************@microsof t.com...
Pardon my ignorance.
But I'd go through the events from the VS2003 IDE and I can't get
Form_QueryUnload events.
Thank You,
mfwoo

"sh**********@yahoo.com" wrote:
Form_QueryUnload event of the form has UnloadMode param which has
different states....and you can detect the windows shutting mode also.

Shivprasad Koirala
C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
http://www.geocities.com/dotnetinterviews/


Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Stephan Steiner | last post by:
Hi I'm having some weird threading issues.. almost at random, if I dare change a line of my code, the shutdown sequence gets messed up. I'm using a thread to receive data from the network, that...
20
by: Doug Thews | last post by:
I ran into an interesting re-pain delay after calling the Abort() method on a thread, but it only happens the very first time I call it. Every time afterward, there is no delay. I've got a...
13
by: Andy Fish | last post by:
Hi, I am using COM interop to invoke MS word from my .net app. If word pops up a dialog box, my thread obviously hangs until the dialog is answered. Here's the problem: because the app is...
18
by: Urs Vogel | last post by:
Hi I wrote an application server (a remoting sinlgeton), where processes must be stopped in very rare cases, done thru a Thread.Abort(). Occasionally, and only after a Thread.Abort(), this...
3
by: Mike Frank | last post by:
What is the correct way to abort a service start in the OnStart method if things were detected which will not let the service run properly? I could simply throw an exception and the serice will...
13
by: Shailesh Humbad | last post by:
Here is an advanced PHP question. Can anyone think of a way to detect the number of bytes written to output when a script is aborted? I am sending a large file to the client, and I want to record...
2
by: Artem | last post by:
When I use the method Thread.Abort, it only sends a request of aborting to OS to stop a thread. The thread itself isn't killed and allocated resources aren't released. I tried to run that thread...
3
by: Eran.Yasso | last post by:
Hi, I wondering where should i use finally and where should i use catch? I have a thread, which the thread dispatcher waits for the thread. if i abort the thread, an exception happens. why...
0
by: kuguy | last post by:
Hi all, I'm new to the forums, so I hope this isn't in the wrong place... I have that "Software caused connection abort: socket write error" exception error that i've never meet before. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...

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.