By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,727 Members | 1,229 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,727 IT Pros & Developers. It's quick & easy.

Detect Log Off or Shut Down process (XP)

P: n/a
Hi there,

I created a simple VB app that runs in the background that I now need to
detect when Windows (XP with SP2) is just about to Shut Down OR the user is
Logging Off. Is this possible?
I require my app to either pause the shutdown/log-off process for a few
seconds whilst it does something important (it's a security thing). As soon
as its finished, Windows should resume logging off the user and/or shutting
down.
Thanks in advance.

Jason.
Feb 17 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jason S wrote:
Hi there,

I created a simple VB app that runs in the background that I now need to
detect when Windows (XP with SP2) is just about to Shut Down OR the user is
Logging Off. Is this possible?
I require my app to either pause the shutdown/log-off process for a few
seconds whilst it does something important (it's a security thing). As soon
as its finished, Windows should resume logging off the user and/or shutting
down.


Just do it in the shutdown code of your app?
Windows will wait patiently (up to a point) for your app to finish.
The QueryUnload event will tell you why its shutting down.

--
Dean Earley (de*********@icode.co.uk)
i-Catcher Development Team

iCode Systems
Feb 17 '06 #2

P: n/a

"Dean Earley" <de*********@icode.co.uk> wrote in message
news:43**********************@news.zen.co.uk...
Jason S wrote:
Hi there,

I created a simple VB app that runs in the background that I now need to
detect when Windows (XP with SP2) is just about to Shut Down OR the user
is Logging Off. Is this possible?
I require my app to either pause the shutdown/log-off process for a few
seconds whilst it does something important (it's a security thing). As
soon as its finished, Windows should resume logging off the user and/or
shutting down.


Just do it in the shutdown code of your app?
Windows will wait patiently (up to a point) for your app to finish.
The QueryUnload event will tell you why its shutting down.

--
Dean Earley (de*********@icode.co.uk)
i-Catcher Development Team

iCode Systems

Thanks. I never actually sussed out the QueryUnload event to be honest.
Works! =)

Jason.
Feb 18 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.