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

Shut Down folder like the Startup folder

Hi,

I would like a program invoked when the computer is shut
down or a user logs off. Is there a fix way of doing
this. I uses the startup folder to run the program, but I
need to run it when the computer shuts down as well.

best regards and thanks
Jesper
Nov 15 '05 #1
2 1813
Hi,

My guess is you need to develop a windows service and there you may use the
"ExitWindows" fuction to detect the windows exit and through the service you
can invoke the application.

Public Declare Function ExitWindows Lib "user32" Alias "ExitWindows" (ByVal
dwReserved As Long, ByVal uReturnCode As Long) As Long

Nirosh.

"Jesper DK" <je****@hotmail.com> wrote in message
news:01****************************@phx.gbl...
Hi,

I would like a program invoked when the computer is shut
down or a user logs off. Is there a fix way of doing
this. I uses the startup folder to run the program, but I
need to run it when the computer shuts down as well.

best regards and thanks
Jesper

Nov 15 '05 #2
Champika Nirosh wrote:
Hi,

My guess is you need to develop a windows service and there you may use the
"ExitWindows" fuction to detect the windows exit and through the service you
can invoke the application.

Public Declare Function ExitWindows Lib "user32" Alias "ExitWindows" (ByVal
dwReserved As Long, ByVal uReturnCode As Long) As Long

Nirosh.

"Jesper DK" <je****@hotmail.com> wrote in message
news:01****************************@phx.gbl...
Hi,

I would like a program invoked when the computer is shut
down or a user logs off. Is there a fix way of doing
this. I uses the startup folder to run the program, but I
need to run it when the computer shuts down as well.

best regards and thanks
Jesper


You should be able to handle WM_ENDSESSION message and do things that
you would like to do before returning from that handler.

--
Girish Bharadwaj

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jesper | last post by:
Hi, I would like a program invoked when the user commands the computer to shut down. Just like it can be invoked at startup by placing it in the startupfolder. Thanks, Jesper.
1
by: Jesper Dk | last post by:
Hi, I need to invoke a program when the commands the computer to logs of or shut down. Is there an equivalent to the startup folder for this purpose. Best regards Jesper.
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...
4
by: Diogo Alves - Software Developer | last post by:
Hi, I have a application developed by me in C# that does not let windows shut down! What is the problem? is this a Framework bug? I would like to receive some feedback about this issue
2
by: Daniel | last post by:
Is there any way for System.IO.StreamWriter Write method to write out part of the string to file. such as if the machine is shut down half way through? or does the file not actually exist until the...
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...
5
by: Bruce W.1 | last post by:
I know how to setup an ASP.NET project and website. But I'm not clear on how this is done with classic ASP. I've heard people say they need to shut down ASP before they can modify any of the...
5
by: James Radke | last post by:
Hello, I am using some external functions supplied by an ERP vendor in a windows.forms application (vb.net, visual studio.net 2003) The functions are defined as follows: ' Max startup and...
0
by: ArkJ | last post by:
Hello. I have a little problem. I created a little Service which uses SIP, all works rather well, but when I want to shut it down in the Services panel, it looks as if it's shut down, but in fact...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.