Jump to content

Run application before shutdown


Recommended Posts

Guest krzysiek kubeczka
Posted

Hi all,

 

I would like to run an application after user chooses Turn Off

Computer from Menu Start and before Windows XP really starts to quit

everything and shut down.

 

Further more I need to know how to from my application really continue

with shutdown or abort and dispose the "Turn off" dialog box.

 

Which command is performed when "Turn off" button is selected? How to

exchange this command with my application?

 

Thanks for any help,

  • Replies 1
  • Created
  • Last Reply

Popular Days

Guest Newbie Coder
Posted

Re: Run application before shutdown

 

Czesc Chris,

 

Basically you need to trap a few things

 

When the user logs-off or shuts down it uses ExitWindowsEx API function using

the SE_SHUTDOWN_PRIVILEGE token. You need to use WndProc to trap the Windows

Message (WM_QUERYENDSESSION), revoke the shutdown privilege, run your

application & wait for application exit then allow the shutdown privilege again

using then use ExitWindowsEx API again to continue shutdown

 

Bardzo latwy jest - na prawde

 

Czy masz GG?

 

Na razie,

 

--

Newbie Coder

(It's just a name)

 

 

"krzysiek kubeczka" <krzysztof.kubeczka@gmail.com> wrote in message

news:1190383184.272717.238910@o80g2000hse.googlegroups.com...

> Hi all,

>

> I would like to run an application after user chooses Turn Off

> Computer from Menu Start and before Windows XP really starts to quit

> everything and shut down.

>

> Further more I need to know how to from my application really continue

> with shutdown or abort and dispose the "Turn off" dialog box.

>

> Which command is performed when "Turn off" button is selected? How to

> exchange this command with my application?

>

> Thanks for any help,

>


×
×
  • Create New...