473,756 Members | 6,250 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11759
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*********@ic ode.co.uk)
i-Catcher Development Team

iCode Systems
Feb 17 '06 #2

"Dean Earley" <de*********@ic ode.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*********@ic ode.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
4016
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
1541
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 automation, and we've had cases when the file was shut down unexpectedly and our normal disconnection code doesn't run. The next time the calling app tries to open the file, the connection dialog pops up. Users can't even click it away or enter a...
4
5847
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 visible/restored to the desktop, and I tell windows to restart, windows shuts down fine. If the main form is minimized to the tray and I tell windows to restart, other desktop apps close down fine but my program's icon remains sat in the system...
5
1906
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 kind of bug or wrong configuration ? I don´t want my asp.net process to ever shut down, because I want to keep data, object etc, in ram. I hope someone can give me good advices.
12
17060
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 is being closed? It is easy enough if the user selects "exit" from this tray icon but how can you detect if Windows is closing the program down? Normally I would simply do something in the Form.Closing event but without a form how can you...
4
1900
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 it could shutdown itself? Application already closes itself gracefully if Application_Disposed is called, but this is not called in this case. Thanks, Harri
5
4382
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 detect when its containing app pool or app domain is requesting a shutdown (when it is recycling, for example). I looked at the Application_End method in global.asax, as well as the System. AppDomain.CurrentDomain.DomainUnload event. Neither get...
4
4024
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
4487
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 at certain times, for some reason the program was shut down by something. The process has been running fine until Today, so I don't know where to start looking for the problem. Does Windows XP have some thing that might clash with another program that...
0
9117
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9894
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8542
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7078
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4955
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3651
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3141
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.