Board index » cppbuilder » ExitProcessProc or similar in BDS2006

ExitProcessProc or similar in BDS2006


2006-03-30 05:13:22 AM
cppbuilder46
I'm looking to find some way of running some code right at the last minute
once an application has been terminated.
i.e.
User closes app
Form destructors etc
last minute code here (for me, this will be an optional 'shutdown / restart
/ stand by / hibernate' call, depending on users selection)
app totally shut down and gone from taskmanager
Eventually I found something I thought might be useful - 'ExitProcessProc'.
Trouble is, the function I assigned to it never appears to get called - even
the chunk of code in system.pas - "if Assigned(ExitProcessProc) then" -
isn't called. Well not according to the de{*word*81} anyway.
I had originally put my shutdown function at the end of WinMain, but it's
not last minute enough.
Hopefully someone can help me!
Thanks,
Richard.
 
 

Re:ExitProcessProc or similar in BDS2006

Richard Bradbrook wrote:
Quote
I'm looking to find some way of running some code right at the last minute
once an application has been terminated.

There are #pragmas that allow you to install startup/shutdown code to be
run. It should be in the help. But you may decide that global object
provide what you want in a more portable way.
.a
 

Re:ExitProcessProc or similar in BDS2006

Quote
There are #pragmas that allow you to install startup/shutdown code to be
run.
Thanks, I did read something about those somewhere.
In any case, somehow I managed to miss the 'AddExitProc' function first time
around when I was looking. That seems to do exactly what I need it to.
Trust me to find the solution minutes after I've asked for help!
Richard.
 

{smallsort}