|
-
September 13th, 2001, 05:56 AM
#1
Windows Shut Down Event
I want to make an application that would run in the background and trap the Windows Shut Down event to call a function.
-
September 13th, 2001, 08:07 AM
#2
Re: Windows Shut Down Event
Take a look at the second parameter to the Form QueryUnload event...
-
September 13th, 2001, 08:40 AM
#3
Re: Windows Shut Down Event
Dsj means:
When shutting down, windows gives a quit (=unload all form and close) command to all opened programs. If your program run hidden, it will trig the Query_unload event (with an integer value you have to check as I do not remember right now).
Matter is: if user terminate your program via Program Manager (on winnt) or hitting ctrl+alt+canc and selecting your program in the list of active task, you may or may not have triggered the query_unload, but Windows may not being shutting down...
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
September 13th, 2001, 08:45 AM
#4
Re: Continue form previous
Sorry: hitted submit and Ok too fast...
Now, you may want to call that function on startup of windows, in case you cannot trig the shut down of it: you may do this writing two programs: one should start always at startup (search for run key in registry) and trig on query_unload just to write a new string in RunOnce key of registry. The second should only call the function. The string to write in the RunOnce Key is the path and name + extension of your second exe. This will do the trick: at startup, your second exe will be called, thus activating your function....
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|