-
close frame window/view
I'm doing my first project at work. i'm learning visual c++. I know some c++. My question is when i execute my
program it comes up with a property sheet with tabs. that fine but when you click on the ok button on the bottom
it goes to single document or view window with nothing on it, so I would like when you click on the ok button
it will close(end) your program. I build my application with single document. They want my program to come up
with tabs window and when you close it, for it not to go to the view window.
Thanks,
Jason C.
-
There are serveral ways to close a program. Here is one solution.
- add handler for IDOK in your propertysheet
- call PostMessage(WM_CLOSE) inside the handler function
Code:
AfxGetMainWnd()->PostMessage(WM_CLOSE);
You could also send a message to main frame while inside the IDOK hander. Call PostMessage(WM_CLOSE) in the message handler.
Kuphryn
-
I'm not sure where to add the code. Like, under what function
I could not fine the IDOK(messages handler) in my property sheet class. I'm sorry for my stupidness. If you can explain a
little more for me.
Thanks,
Jason