473,320 Members | 1,854 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,320 software developers and data experts.

Detect Log Off or Shut Down process (XP)

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
2 11745
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Stephane Belzile | last post by:
Is there a way I can detect in vb.Net the power has switched to a UPS unit in case of power failure? Thanks
0
by: John Winterbottom | last post by:
Does anyone know if this is possible? We are running Access XP with Windows XP Prof.. We have an ADP file we are using to print custom reports for a client. It's opened and conntrolled through...
4
by: Claire | last post by:
Running XP pro, SP2. Visual studio .NET 2003. App written in C# I have written an application that hides itself when run and shows a notification icon in the system tray. If the main form is...
5
by: Anders Both | last post by:
If no pages in my asp.net web-system, is being requested for some periode, it seems like the asp.net process is shut down automaticaly. Is this a normal behavior, or does my system contains some...
12
by: Patrick Dugan | last post by:
I have an vb.net application that is a module that uses a "application.run" in the sub main to start. There is no form involved (just a system tray icon) How can you detect when the application...
4
by: Harri Pesonen | last post by:
I have an ASP.NET application that runs threads in background. Application does not close if the web site is stopped. So how can the application get an event when the site has been stopped, so that...
5
by: Bubba | last post by:
Hi, We have HttpHandlers that can process requests for up to 50 minutes. Those HttpHandlers are running in an app domain inside the DefaultAppPool. We'd like the HttpHandlers to be able to...
4
gsgurdeep
by: gsgurdeep | last post by:
Hi to all Friends Tell me the process of auto shut down a pc Running Windows XP Professional SP-2 after a Specified Time. Have A Nice Day.
5
by: Sheena777 | last post by:
I have a program that I have created and that is permanently running in the back ground on a user's PC. This program is used to check if a finger print scanner is on and if not it will be restarted...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.