CtrlGetDlgItem

InstallShield 2014 » InstallScript Language Reference

The CtrlGetDlgItem function retrieves the window handle of a control in a custom dialog. CtrlGetDlgItem is similar to the Windows API GetDlgItem, except that with CtrlGetDlgItem, you can specify the InstallScript dialog name instead of the dialog’s window handle.

Syntax

CtrlGetDlgItem (byval string szDialogName, byval HWND hDialog, byval number nCtrlId);

Parameters

CtrlGetDlgItem Parameters

Parameter

Description

szDialogName

Specify the name of the dialog that contains the control whose handle is being retrieved. The dialog must already exist when the function is called.

If hDialog is not a null string (""), you can specify a null string for szDialogName.

hDialog

Specify the window handle of the dialog that contains the control whose handle is being retrieved. The dialog must already exist when the function is called.

If you specify a string (""), CtrlGetDlgItem determines the dialog’s handle by calling CmdGetHwndDlg using szDialogName.

nCtrlId

Specify the ID of the control whose window handle you want to retrieve.

Return Values

CtrlGetDlgItem returns the window handle of the control or NULL if the control does not exist or an error occurred. GetExtendedErrInfo may return additional error information.

Additional Information

If you are making multiple calls to CtrlGetDlgItem to look up multiple controls, it is recommended that you call CmdGetHwndDlg to get the handle of the dialog and pass it to each function call. If you are looking up the window handle of a single control, it is recommended that you specify the dialog name and specify hDialog as a null string ("").

See Also