Thread: problem closing a window

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    17

    problem closing a window

    I have a program with two windows. I open the second window by pressing a button. And close it using the DestroyWindow( ), I also tried PostQuitMessage(WM_QUIT ). Both of these functions result in the program crashing. When I click on the X in the top right of the window or press alt+F4 the window closes perfectly and returns to the first window.

    Q. What signal is alt+F4 sending to the window.



    p.s I am using VC++
    When i find myself in times of trouble. mother mary comes to me, speaking words of wisdom, let it be C

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>Q. What signal is alt+F4 sending to the window.<<

    A. WM_SYSCOMMAND.

    For future reference you should direct your windows questions to the windows board.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User Rare177's Avatar
    Join Date
    May 2004
    Posts
    214
    WM_CLOSE
    this may be what you are after
    Good Help Source all round
    Good help for win programmers
    you will probably find something in here
    this thing also helps

    if you have never tried any of the above then maybe you should, they help alot

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  2. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  3. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM
  4. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM