Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>getdialogresult()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
GetDialogResult()
Return a result from a dialog with the user
------------------------------------------------------------------------------

Syntax
GetDialogResult( <aDlg>, [ <cId> | <nId> ] )   -->   xResult

Arguments
<aDlg> is an array used to describe the dialog.  It must have
been obtained originally from CreateDialog().

<cId> is a character string identifying the item whose current
value is wanted.

<nId> is a number identifying the item whose current value is
wanted.  This number will probably have been the returned
value from ModalDialog().

Returns
The value associated with the <cId> or <nId>.

Description
Once a dialog has been set up using CreateDialog() and
AppendDialog(), and presented to the user using ModalDialog(),
the GetDialogResult() function can be used to retrieve the
final values of the items in the dialog.

For a checkbox the result is a numeric: zero (0) means off (or
not selected), non-zero means on (or selected).  For a 3-state
check box, one (1) is an X, two (2) is a dark gray colour.
For an edit control the result is a character string.  For a
list box with nothing selected, the result is NIL, with only
one item selected it is a string, and with multiple selections
an array is returned.

Example
aDlg = CreateDialog("Sample Dialog",                        ;
              WS_CAPTION + WS_VSCROLL + WS_HSCROLL          ;
              + WS_SYSMENU + WS_GROUP + WS_TABSTOP          ;
              + WS_THICKFRAME + WS_VISIBLE + WS_POPUP,      ;
              24, 12, 180, 160)

aDlg = AppendDialog(aDlg, "ok", DLG_BUTTON,                 ;
              BS_DEFPUSHBUTTON + WS_TABSTOP                 ;
              + WS_CHILD + WS_VISIBLE,                      ;
              136, 112, 24, 14,  "&Ok")

aDlg = AppendDialog(aDlg, "edit", DLG_EDIT,                 ;
              ES_LEFT + ES_MULTILINE + ES_NOHIDESEL         ;
              + ES_AUTOVSCROLL + ES_AUTOHSCROLL             ;
              + WS_VSCROLL + WS_HSCROLL + WS_BORDER         ;
              + WS_TABSTOP + WS_CHILD + WS_VISIBLE,         ;
              122, 64, 40, 38,  "")

// Hitting ESCAPE returns 0, in case you want to try it...
i = ModalDialog(aDlg, hInst, hWnd)
s = GetDialogResult(aDlg, "edit")
? "Item chosen", i
? "Result of edit ", s


See Also: AppendDialog() CreateDialog() ModalDialog()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson