Has anybody else had the problem where their program doesnt
always exit, despite calling ExitProcess? I havent had the
problem since I've begun using Radasm, but i remember it being
a little annoying to ctrl-shift-esc and close the program all the
time.

(ctrl-shift-esc being win2k's way of opening the task manager)
Posted on 2002-01-25 18:19:09 by matthew
Are you sure the program wasn't stuck in an infinite loop? ExitProcess usually works if the processor gets there. What OS was that on?
Posted on 2002-01-25 19:01:37 by bitRAKE
matthew,

Show your code plz.

I've seen similiar, in windows message WM_CLOSE, WM_DESTROY

I remember App can not always receive WM_CLOSE msg.
(If I'm long reply plz.)
Posted on 2002-01-25 19:26:55 by muzidowa
Actually, and unfortunently, I havent had the problem for
a while now. And I don't have any code to show..

The program basically killed another app called a messagebox
and exited.. But it would still stay in memory. Which made it
really annoying when i was compiling alot.
Posted on 2002-01-26 00:02:31 by matthew
Your code probably never reached the ExitProcess call. I've never
seen a situation where ExitProcess doesn't end the application.
TerminateProcess can sometimes fail when terminating another
process (assuming that TerminateProcess is what the wink task
manager uses to kill apps). Sometimes when an app has lock on
certain resources (eg nero when having locked your recorder), I
can't kill it (bad if nero has hung). And the only way I know of to
unlock my drive is to shut down my box - which takes around 5 to
10 minutes when nero has this lock :(.

But I've never seen ExitProcess fail :P.
Posted on 2002-01-26 03:29:45 by f0dder
Matthew,
ExitProcess can only be used to kill your own process, not a foriegn one. When it is invoked, all the dlls are sent PROCESS_DETACH messages, this is to allow them to clean up any resources they are using. If these dlls don't clean up properly, or just generally 'hang', then it is possible that your ExitProcess is never being finished.

If you are trying to kill a foriegn process, use TerminateProcess (which gives it a nasty sudden death), or post a WM_QUIT to its top level window.
Posted on 2002-01-28 04:12:58 by sluggy
I am just a dum newby but maybe

1. You didnt close the right file handle when trying to close your other application.
2. The program never reached the "ExitProcess" call and encountered an exception.
3. During trying to close the other file, the token changed privileges.

Maybe try putting an
invoke MessageBox NULL, ADDR Debug, ADDR SomeCaption, MB_OK
just before your Invoke ExitProcess to see if it works ?

Just some lose change, not sure if my currency is of any worth.
Posted on 2002-01-28 23:37:53 by prana