Quitting Dialog Boxes??

What message does a dialog box receive when the x (top right of a window) is pressed? It isn't WM_DESTROY like it is with the main window.
Learning Win32 Api and some DirectX. How long did it take you to learn DirectX and the Windows API.

Comments

  • SephirothSephiroth Fayetteville, NC, USA
    : What message does a dialog box receive when the x (top right of a window) is pressed? It isn't WM_DESTROY like it is with the main window.Learning Win32 Api and some DirectX. How long did it take you to learn DirectX and the Windows API.
    :
    A) It gets WM_CLOSE if I am not mistaken.
    B) It took me about a month to learn the Windoze C++ API.
    C) I spent a month on DX and was able to do NOTHING. I then spent about thirty minutes learning OpenGL and had an OpenGL window up with polygons in it. In another three hours I had a 3D engine without collision detection ro physics, but fully textured and culled!

    I recomend learning just the Windoze API before you try any hardware accelerated modes like DX or OpenGL. Then I have to recomend OpenGL over anything DX.

    -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

  • : What message does a dialog box receive when the x (top right of a window) is pressed? It isn't WM_DESTROY like it is with the main window.Learning Win32 Api and some DirectX. How long did it take you to learn DirectX and the Windows API.
    :
    What is it you trying to do?
    I think that [X] message depends on how dialog box was launched: if it is modal - I think you get the WM_COMMAND with IDCANCEL - in other words it mimics the pressing of CANCEL button, but I am not sure about that... if it is modeless - then you get the WM_CLOSE I think and then you close it as you do with regular windows - call 'DestroyWindow()'.

    It requires some research from your side: set a breakpoint in debugger at WM_COMMAND/WM_CLOSE and see what message is it and what parameters are passed by windows when you click on [X].

  • : : What message does a dialog box receive when the x (top right of a window) is pressed? It isn't WM_DESTROY like it is with the main window.Learning Win32 Api and some DirectX. How long did it take you to learn DirectX and the Windows API.
    : :
    : What is it you trying to do?
    : I think that [X] message depends on how dialog box was launched: if it is modal - I think you get the WM_COMMAND with IDCANCEL - in other words it mimics the pressing of CANCEL button, but I am not sure about that... if it is modeless - then you get the WM_CLOSE I think and then you close it as you do with regular windows - call 'DestroyWindow()'.
    :
    : It requires some research from your side: set a breakpoint in debugger at WM_COMMAND/WM_CLOSE and see what message is it and what parameters are passed by windows when you click on [X].
    :
    :


    Is this what your looking for?

    case WM_COMMAND:
    if(wParam == IDCANCEL) EndDialog(hWnd, 0);


    Thats what I've been using & it seems to work fine.
    Stoic Joker

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories