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

Shut Down folder like the Startup folder

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.