Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing dialog application

Status
Not open for further replies.

Feddozz

Mechanical
Dec 15, 2005
16
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:
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
What should I add to make it appen?

Thanks
 
Replies continue below

Recommended for you

Feddozz:

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 absoft, lahey and other fortran-windows compilers.
 
I found the Intel Forum very good.

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor