Thread: close frame window/view

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    6

    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.

  2. #2
    kuphryn
    Guest
    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

  3. #3
    Registered User
    Join Date
    Aug 2002
    Posts
    6
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Close an HTTPListenerResponse.OutputStreram
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 04-23-2008, 11:00 PM
  2. open() and close()
    By SoFarAway in forum C Programming
    Replies: 3
    Last Post: 04-08-2005, 01:16 PM
  3. Animation not working....
    By aquinn in forum C Programming
    Replies: 7
    Last Post: 02-19-2005, 05:37 AM
  4. close frame window/view
    By Jasonc in forum Windows Programming
    Replies: 1
    Last Post: 08-23-2002, 01:18 PM
  5. Ghost in the CD Drive
    By Natase in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 10-12-2001, 05:38 PM