I searched the example files, the offline help file, and the forums, and I couldn't find an answer to something that seems like it should be really easy:
How do you close a dialog window from within your dialog callback?
For example, if you want to detect that the user has pressed the escape key, and shut the program down when they do that, how do you get the window to close?
I set up a timer in my dialog window callback like so:
Case %WM_TIMER
If GetAsyncKeyState(%VK_ESCAPE) Then
Dialog Send CBHNDL, %WM_CLOSE, 0, 0
End If
and I try to send myself a %WM_CLOSE event, but this causes the app to crash when I hit escape.
Clicking on the close box, and having my normal %WM_CLOSE code run works perfectly.
Any ideas? This has got to be simple, but I just couldn't find any examples of it.
*Brian
Bookmarks