Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which is the simplest way to close an application?

Status
Not open for further replies.

julych

Programmer
Dec 21, 2002
14
BG
Which is the simplest way to terminate a dialog-based application?
 
...I mean how one application can terminate another one.
 
Use:

exit() or _exit().
Terminate the calling process after cleanup (exit) or immediately (_exit).

void exit( int status );
void _exit( int status );

include <process.h> or <stdlib.h>

eg:
exit(0);

/Srikanth

What happens if you’re scared half to death twice?
 
hmm

i replied before u put the second post ;)

/Srikanth

What happens if you’re scared half to death twice?
 
I guess you can't unless you own the app to be terminated. do you?

/Srikanth

What happens if you’re scared half to death twice?
 
If you want to exit a dialog box you should use EndDialog. Method exit interrupts the application.

Ion Filipski
1c.bmp
 
Yes I own both the apps. I found a way to resolve this problem, but my bigger problem remains - noone can't tell me how to reload the default resources of the application at runtime. This is the reason I had to create a temporary exe (or attach dll) which starts immediately after closing the main application and restarts it. I'm writing a new post here, but I doubt whether anyone can help me.
 
when you need a resource you will load it in a way deppendent of type of resource. For icons use LoadIcon, for cursors LoadCursors. You should learn how to use resources, because you're doing a lot of unusual things only because you don't know how to use something. A good point to see any details is MSDN.

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top