Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Quitting Dialog Boxes?? Posted by SlickMan5933 on 22 Jan 2002 at 10:22 PM
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.<br>Learning Win32 Api and some DirectX. How long did it take you to learn DirectX and the Windows API.
Report
Re: Quitting Dialog Boxes?? Posted by Sephiroth on 22 Jan 2002 at 11:35 PM
: 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.

-Sephiroth

Report
Re: Quitting Dialog Boxes?? Posted by AsmGuru62 on 23 Jan 2002 at 7:47 AM
: 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].

Report
Re: Quitting Dialog Boxes?? Posted by Stoic Joker on 24 Jan 2002 at 2:47 PM
: : 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




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.