Jump to content

WM_QUERYENDSESSION


Recommended Posts

  • 2 years later...

I would love to do this, but I need to delay the shutdown:

Any idea how to delay it until I am done with some housekeeping?

Or can I figure out exactly what the shutdown params are (shutdown/restart/etc), then cancel it, do my thing and reinitiate it?

Link to comment

QUOTE(jed @ Sep 11 2007, 01:26 PM)

I would love to do this, but I need to delay the shutdown:

Any idea how to delay it until I am done with some housekeeping?

Or can I figure out exactly what the shutdown params are (shutdown/restart/etc), then cancel it, do my thing and reinitiate it?

I keep a shortcut on my desktop to "C:\WINDOWS\system32\shutdown.exe -a" which aborts any shutdowns that I notice quickly enough. I'm sure a Windows DLL alternative is out there but calling this should work as well.

Link to comment

QUOTE(jed @ Sep 11 2007, 04:26 PM)

I would love to do this, but I need to delay the shutdown:

Any idea how to delay it until I am done with some housekeeping?

Or can I figure out exactly what the shutdown params are (shutdown/restart/etc), then cancel it, do my thing and reinitiate it?

The Windows message queue example is not really meant to hook directly into the queue but only monitor it. In order to hook into that event you would have to modify the C source code of that example to do that specifically. Not to difficult but without some good C knowledge not advisable.

Another way might be that newer LabVIEW versions will send a filter event in the event handling structure "Application Instance Close?" which you can use to disallow shutting down the app. Not sure if it will disallow shutting down the session directly though. But it should be enough to detect that there might be a shutdown in progress and allow you to execute the command Adam mentioned to abort that.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.