Visible to Intel only — GUID: GUID-14794DDB-FF1C-46ED-9AD6-8D3F56D534DE
Visible to Intel only — GUID: GUID-14794DDB-FF1C-46ED-9AD6-8D3F56D534DE
DLGMODELESS
Dialog Function: Displays a modeless dialog box. This routine is only available for Windows.
USE IFLOGM
result = DLGMODELESS (dlg[,nCmdShow,hwndParent])
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. The variable passed to this function must remain in memory for the duration of the dialog box, that is from the DLGINIT call through the DLGUNINIT call. The variable can be declared as global data in a module, as a variable with the STATIC attribute, or in a calling procedure that is active for the duration of the dialog box. It must not be an AUTOMATIC variable in the procedure that calls DLGMODELESS. |
||||||||||||||||||||||
nCmdShow |
(Input) Integer. Specifies how the dialog box is to be shown. It must be one of the following values:
The default value is SW_SHOWNORMAL. |
||||||||||||||||||||||
hwndParent |
(Input) Integer. Specifies the parent window for the dialog box. The default value is determined in this order:
|
The result type is LOGICAL(4). The value is .TRUE. if the function successfully displays the dialog box. Otherwise the result is .FALSE..
During execution, DLGMODELESS displays a modeless dialog box and returns control to the calling application. The dialog box remains active until DLGEXIT is called, either explicitly or as the result of the invocation of a default button callback.
DLGMODELESS is typically used in a Windows application. The application must contain a message loop that processes Windows messages. The message loop must call DLGISDLGMESSAGE for each message. See the example below in the Example section. Multiple modeless dialog boxes can be displayed at the same time. A modal dialog box can be displayed from a modeless dialog box by calling DLGMODAL from a modeless dialog callback. However, DLGMODELESS cannot be called from a modal dialog box callback.
DLGMODELESS also can be used in a Console, DLL, or LIB project. However, the requirements remain that the application must contain a message loop and must call DLGISDLGMESSAGE for each message. For an example of calling DLGMODELESS in a DLL project, see the Dllprgrs sample in the ...\SAMPLES\DIALOGfolder.
Use the DLG_INIT callback with DLGSETSUB to perform processing immediately after the dialog box is created and before it is displayed, and to perform processing immediately before the dialog box is destroyed.
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) )
! 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