Shut Down folder like the Startup folder

  • Thread starter Thread starter Jesper DK
  • Start date Start date
J

Jesper DK

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
 
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.
 
Champika said:
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.
You should be able to handle WM_ENDSESSION message and do things that
you would like to do before returning from that handler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top