# DLGISDLGMESSAGE, DLGISDLGMESSAGEWITHDLG (W*S)

Dialog Functions: Determine whether the specified message is intended for one of the currently displayed modeless dialog boxes, or a specific dialog box.

## Module

USE IFLOGM

result = DLGISDLGMESSAGE (mesg)

result = DLGISDLGMESSAGEWITHDLG (mesg, dlg)

mesg | (Input) Derived type `T_MSG`. Contains a Windows message.
dlg | (Input) Derived type `dialog`. Contains dialog box parameters. The components of the type `dialog` are defined with the PRIVATE attribute, and cannot be changed or individually accessed by the user.

## Results

The result type is LOGICAL(4). The result is .TRUE. if the message is processed by the dialog box. Otherwise, the result is .FALSE. and the message should be further processed.

DLGISDLGMESSAGE must be called in the message loop of Windows applications that display a modeless dialog box using DLGMODELESS. DLGISDGMESSAGE determines whether the message is intended for one of the currently displayed modeless dialog boxes. If it is, it passes the message to the dialog box to be processed.

DLGISDLGMESSAGEWITHDLG specifies a particular dialog box to check. Use DLGISDLGMESSAGEWITHDLG when the message loop is in a main application and the currently active modeless dialog box was created by a DLL.

## Example

      use IFLOGM
      include 'resource.fd'
      type (DIALOG) dlg
      type (T_MSG)  mesg
      integer*4 ret
      logical*4 lret
      ...
      ! Create the main dialog box and set up the controls and callbacks
      lret = DlgInit(IDD_THERM_DIALOG, dlg)
      lret = DlgSetSub(dlg, IDD_THERM_DIALOG, ThermSub)
      ...
      lret = DlgModeless(dlg, nCmdShow)
      ...
      ! Read and process messsages
      do while( GetMessage (mesg, NULL, 0, 0) /= 0 )
         ! Note that DlgIsDlgMessage must be called in order to give
         ! the dialog box first chance at the message.
         if ( DlgIsDlgMessage(mesg) .EQV. .FALSE. ) then
            lret = TranslateMessage( mesg )
            ret  = DispatchMessage( mesg )
         end if
      end do
      ! Cleanup dialog box memory and exit the application
      call DlgUninit(dlg)
      WinMain = mesg%wParam
      return

Parent topic: Dialog Library Routines

## See Also

DLGMODELESS