CmdGetHwndDlg

The CmdGetHwndDlg function retrieves the window handle of the dialog identified by szDialogName. The dialog already must have been defined with EzDefineDialog or DefineDialog and initialized by calling WaitOnDialog.

CmdGetHwndDlg is typically called in the DLG_INIT routine for a custom dialog. The handle of the dialog is assigned to a HWND variable to be used by other functions that need it.

Note:When a dialog is initialized with the WaitOnDialog function, a window handle is assigned to it; that handle is associated with the dialog only until it is closed by a call to EndDialog. If you call WaitOnDialog to open a dialog that has been opened and closed previously in your script, you must call CmdGetHwndDlg again to get the new handle. The old handle is no longer valid.

Syntax

CmdGetHwndDlg ( szDialogName );

Parameters

CmdGetHwdDlg Parameters

Parameter

Description

szDialogName

Specifies the name of a dialog that has been defined with EzDefineDialog or DefineDialog.

Return Values

CmdGetHwdDlg Return Values

Return Value

Description

> 0

The window handle of the dialog that was specified by szDialogName.

< 0

CmdGetHwndDlg was unable to retrieve the handle. Verify that szDialogName refers to a dialog that has been properly defined and initialized.