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>checkdlgbutton()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CheckDlgButton()
Add/remove a check mark for a dialog button or check box
------------------------------------------------------------------------------

Syntax
CheckDlgButton( <aDlg>, <cId>, <nValue> )   -->   nil

OR:

CheckDlgButton( <hWndDlg>, <nId>, <nValue> )   -->   nil

Arguments

EITHER:

<aDlg> is an array used to describe the dialog, obtained from
CreateDialog().

<cId> is a character string identifying the item whose value
is being changed.

<nValue> is a number specifying the new state of the button or
check box.  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.

OR:

<hWndDlg> is the handle of the dialog window.

<nId> is the numeric id of the item whose value is being
changed.

<nValue> is a number specifying the new state of the button or
check box.  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.

Returns
NIL.

Description
EITHER:
For a dynamic dialog, once a dialog has been set up using
CreateDialog() and AppendDialog(), this function can be used
to set the initial state of buttons and check boxes.

OR:
For a dialog created from a dialog resource by either
DialogBox() or the second form of CreateDialog(), this
function can be called from the <bAction> code block used to
handle the messages sent to the dialog.

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, "3state", DLG_BUTTON,             ;
              BS_AUTO3STATE + WS_GROUP + WS_CHILD           ;
              + WS_VISIBLE,                                 ;
              10, 70, 40, 20, "&3State")

CheckDlgButton(aDlg, "3state", 1)

// 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() DialogBox() ModalDialog()

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