Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Exit via X on title bar

presser
Beginner
788 Views
Simular to the question of pmichael from Jul 1,2002 I got a problem in my QuickWin application using 'officially not allowed' modeless dialog boxes, which works just fine, so far. However when the user clicks on the Title Bar X of the dialog box, the window does not disappear like with the Cancel or OK button. I can intercept WM_COMMAND and call EXIT, but this ends only the doloop for the messages. Can I do anything to resolve this problem?
Thank you very much
W.Presser
0 Kudos
2 Replies
david_jones
Beginner
788 Views
One approach is to set a flag in a common block or module when the X button is pressed and put a test for this flag in your main loop and stop or call exit from there. Depending on your structure, you may need to modify things so the the test is done only ever tenth of a second or so, rather than continually ... i.e. avoid expending all the CPU time on doing the test.
0 Kudos
Jugoslav_Dujic
Valued Contributor II
788 Views
Does your PROGRAM end with a message loop or is it located elsewhere? If the latter (which is my guess since I wouldn't expect such behaviour with the first approach), try intercepting WM_CLOSE of the main window and insert a PostQuitMessage there before calling CallWindowProc. That PostQuitMessage should cause secondary message loop to exit.

Just a guess, didn't try it myself.
0 Kudos
Reply