exit button

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2008
Posts: 42
Reputation: lahom is an unknown quantity at this point 
Solved Threads: 0
lahom lahom is offline Offline
Light Poster

exit button

 
0
  #1
Jun 29th, 2008
hi
i have an application made of several dialogs
each has its own exit button
my question:
whan i press the exit button ... iwant to exit the whole application (not exit the present dialog and return to the Previous one )
how can i do that .....please help me out with this
thank u all
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 978
Reputation: mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice 
Solved Threads: 208
mitrmkar mitrmkar is offline Offline
Posting Shark

Re: exit button

 
0
  #2
Jun 29th, 2008
Originally Posted by lahom View Post
hi
i have an application made of several dialogs
each has its own exit button
my question:
whan i press the exit button ... iwant to exit the whole application (not exit the present dialog and return to the Previous one )
how can i do that .....please help me out with this
thank u all
Are you on Windows or ..? Are you using some GUI library?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,442
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1474
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: exit button

 
0
  #3
Jun 29th, 2008
In the event handler for the exit button send a WM_QUIT event message to the program's main thread. More information is discussed here.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 99
Reputation: FTProtocol has a little shameless behaviour in the past 
Solved Threads: 1
FTProtocol FTProtocol is offline Offline
Junior Poster in Training

Re: exit button

 
0
  #4
Jun 29th, 2008
ah i just coded a win32 application and i used the following:

Quit program ( the [ x ] ) in the corner
  1. case WM_DESTROY:
  2. {
  3. PostQuitMessage(0);
  4. break;
  5. }

you could also do

  1. case <button name>:
  2. {
  3. PostQuitMessage(0);
  4. break;
  5. }

PostQuitMessage();

http://msdn.microsoft.com/en-us/libr...45(VS.85).aspx

I hope i did this correctly because last time i tryed to give help i got a warning
Last edited by FTProtocol; Jun 29th, 2008 at 7:22 am.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 42
Reputation: lahom is an unknown quantity at this point 
Solved Threads: 0
lahom lahom is offline Offline
Light Poster

Re: exit button

 
0
  #5
Jun 29th, 2008
my application is MFC dialog based application
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 42
Reputation: lahom is an unknown quantity at this point 
Solved Threads: 0
lahom lahom is offline Offline
Light Poster

Re: exit button

 
0
  #6
Jun 29th, 2008
i used
PostMessage(WM_QUIT);
and got
Error: CWinThread::PumpMessage called when not permitted.
could someone explain pleeease
Last edited by Ancient Dragon; Jun 29th, 2008 at 6:43 pm. Reason: disabled smilies
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,442
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1474
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: exit button

 
0
  #7
Jun 29th, 2008
where did you put that PostMessage(). And why didn't you just use PostQuitMessage() as previously suggested?
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC