Dlg Function

Purpose

returns the window handle of a Dialog box.

Syntax

h = Dlg(DialogID)

h = Dlg(DialogID,ItemID)

DialogID, ItemID: iexp
h: Handle

Description

Dlg(DialogID) returns the window handle of a previously opened Dialog box. The parameter is the number used in the Dialog # command.

If DialogID contains a number of a Dialog window previously opened with Dialog # and ItemID is the number of a Dialog item DlgItem(DialogID,ItemID) returns the Windows handle of the item.

Example

Dialog # 1, 10, 10, 100, 150, "This is a Dialog", 128

PushButton "Ok", IDOK, 10, 10, 80, 20

PushButton "Cancel", IDCANCEL, 10, 30, 80, 20

LText "Cancel", 21, 10, 50, 80, 40

EndDialog

_Win$(Dlg(1, 21)) = "Label"

_Win$(Dlg(1)) = "Dialog box title"

ShowDialog # 1

Remarks

DlgItem(DialogID,ItemID) is a synonym for Dlg(DialogID,ItemID) and can be used instead.

See Also

Dialog, DlgItem()

{Created by Sjouke Hamstra; Last updated: 03/10/2014 by James Gaite}