Closing dialog application
Closing dialog application
(OP)
Hello everybody,
I'm developing a small dialog application. it's got the cancel button, when you press it it closes the application, and that's fine.
I want the application to be closed when I type in Alt+F4 or I click on the red cross button, the button you usually use to close every window.
My code at the moment appears like this:
What should I add to make it appen?
Thanks
I'm developing a small dialog application. it's got the cancel button, when you press it it closes the application, and that's fine.
I want the application to be closed when I type in Alt+F4 or I click on the red cross button, the button you usually use to close every window.
My code at the moment appears like this:
CODE
SUBROUTINE WinATDSub( dlg, id, callbacktype )
!DEC$ ATTRIBUTES DEFAULT :: WinATDSub
use user32
use dflogm
implicit none
include 'resource.fd'
type (dialog) dlg
integer id, callbacktype
if (callbacktype == dlg_destroy) then
call PostQuitMessage(0)
endif
END SUBROUTINE WinATDSub
!DEC$ ATTRIBUTES DEFAULT :: WinATDSub
use user32
use dflogm
implicit none
include 'resource.fd'
type (dialog) dlg
integer id, callbacktype
if (callbacktype == dlg_destroy) then
call PostQuitMessage(0)
endif
END SUBROUTINE WinATDSub
Thanks
RE: Closing dialog application
It is called SC_CLOSE in MFC but I don't think you want to go down that path.
RE: Closing dialog application
The Dialog function in Intel 9.0 or higher and CVF 6.6c permits the dialog to be introduced as mode or modeless dialogs. There is a starting procedure dlgint(Idd_Dialog_Name,dlg). To close the dialog the procedure is dlgUnint(dlg).
There may be other commands from a dialog system similar to the above. I have found Intel to be an excellent source for fortran-windows interface. You can also search for www.indowsway.com, absoft, lahey and other fortran-windows compilers.
RE: Closing dialog application
What I found:
the DFLOGM code checks if a button with IDCANCEL exists, and, not having found it, does nothing.
Solution: add a button with "Close" or "Cancel" caption and assign identifier IDCANCEL to it (or change the properties of "Apply" button if you don't need it). The button may even be hidden (Visible=false) if you don't want it visible.'
Thank you all for your help.