Connecting Tech Pros Worldwide Forums | Help | Site Map

Shut Down folder like the Startup folder

Jesper DK
Guest
 
Posts: n/a
#1: Nov 15 '05
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

Champika Nirosh
Guest
 
Posts: n/a
#2: Nov 15 '05

re: Shut Down folder like the Startup folder


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" <jeodni@hotmail.com> wrote in message
news:01bd01c393b1$97d614f0$a001280a@phx.gbl...[color=blue]
> 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[/color]


Girish Bharadwaj
Guest
 
Posts: n/a
#3: Nov 15 '05

re: Shut Down folder like the Startup folder


Champika Nirosh wrote:
[color=blue]
> 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" <jeodni@hotmail.com> wrote in message
> news:01bd01c393b1$97d614f0$a001280a@phx.gbl...
>[color=green]
>>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[/color]
>
>
>[/color]
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

Closed Thread