Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

Dialog operations
[Windowing functions]

Data Structures

Defines

Typedefs

Functions


Define Documentation

#define CreateMainWindowIndirect pDlgTemplate,
hOwner,
WndProc   )     CreateMainWindowIndirectParam(pDlgTemplate, hOwner, WndProc, 0)
 

An simplified version of CreateMainWindowIndirectParam.

This macro calls CreateMainWindowIndirectParam with lParam set to be 0.

Definition at line 6652 of file window.h.

#define DLGC_3STATE   0x0800
 

3 States button item.

Definition at line 6559 of file window.h.

#define DLGC_BUTTON   0x2000
 

Button item: can be checked.

Definition at line 6569 of file window.h.

#define DLGC_DEFPUSHBUTTON   0x0100
 

Default pushbutton.

Definition at line 6544 of file window.h.

#define DLGC_HASSETSEL   0x0080
 

Understands EM_SETSEL message.

Definition at line 6538 of file window.h.

#define DLGC_PUSHBUTTON   0x0200
 

Non-default pushbutton.

Definition at line 6549 of file window.h.

#define DLGC_RADIOBUTTON   0x0400
 

Radio button.

Definition at line 6554 of file window.h.

#define DLGC_STATIC   0x1000
 

Static item: don't include.

Definition at line 6564 of file window.h.

#define DLGC_WANTALLKEYS   0x0004
 

Control wants all keys.

Definition at line 6522 of file window.h.

#define DLGC_WANTARROWS   0x0001
 

Control wants arrow keys.

Definition at line 6512 of file window.h.

#define DLGC_WANTCHARS   0x0008
 

Want MSG_CHAR messages.

Definition at line 6527 of file window.h.

#define DLGC_WANTENTER   0x0010
 

Control wants enter keys.

Definition at line 6533 of file window.h.

#define DLGC_WANTTAB   0x0002
 

Control wants tab keys.

Definition at line 6517 of file window.h.


Typedef Documentation

typedef struct _CTRLDATA CTRLDATA
 

Structure which defines a control.

typedef struct _DLGTEMPLATE DLGTEMPLATE
 

Structure which defines a dialogbox.

Example:

static DLGTEMPLATE DlgInitProgress =
{
    WS_BORDER | WS_CAPTION, 
    WS_EX_NONE,
    120, 150, 400, 130, 
    "VAM-CNC is initializing",
    0, 0,
    3, NULL,
    0
};

static CTRLDATA CtrlInitProgress [] =
{ 
    {
        "static",
        WS_VISIBLE | SS_SIMPLE,
        10, 10, 380, 16, 
        IDC_PROMPTINFO, 
        "Initialize...",
        0
    },
    {
        "progressbar",
        WS_VISIBLE,
        10, 40, 380, 20,
        IDC_PROGRESS,
        NULL,
        0
    },
    {
        "button",
        WS_TABSTOP | WS_VISIBLE | BS_DEFPUSHBUTTON, 
        170, 70, 60, 25,
        IDOK, 
        "OK",
        0
    }
};


Function Documentation

void GUIAPI CheckDlgButton HWND  hDlg,
int  nIDDlgItem,
int  nCheck
 

Changes the check status of a button control.

This function changes the check status of the button control whose identifier is nIDDlgItem in the dialog box hDlg.

Parameters:
hDlg The handle to the dialog box.
nIDDlgItem The identifier of the control.
nCheck The state of the button. If the button is a normal button, the value being zero means the button is checked, otherwise unchecked. If the button is a special button with three states, the value can be one of the following values:
  • BST_UNCHECKED
    The button is unchecked.
  • BST_CHECKED
    The button is checked.
  • BST_INDETERMINATE
    The button is in indeterminate state.
See also:
CheckRadioButton, IsDlgButtonChecked

void GUIAPI CheckRadioButton HWND  hDlg,
int  idFirstButton,
int  idLastButton,
int  idCheckButton
 

Adds a check mark to (checks) a specified radio button in a group and removes a check mark from (clears) all other radio buttons in the group.

This function adds a check mark to (checks) the specified radio button idCheckButton in a group between idFirstButton and idLastButton, and removes a check mark from (clears) all other radio buttons in the group.

Parameters:
hDlg The handle to the dialog box.
idFirstButton The identifier of the first control in the group.
idLastButton The identifier of the last control in the group.
idCheckButton The identifier of the control to be checked.
See also:
CheckDlgButton

HWND GUIAPI CreateMainWindowIndirectParam PDLGTEMPLATE  pDlgTemplate,
HWND  hOwner,
WNDPROC  WndProc,
LPARAM  lParam
 

Uses a dialog template to create a modeless main window and controls in it, and pass a parameter to the window procedure.

This function uses a dialog template pointed to by pDlgTemplate to create a modeless main window and controls in it. The parameter specified by lParam will be passed to the window procedure as the second paramter of MSG_INITDIALOG message.

Parameters:
pDlgTemplate The pointer to a DLGTEMPLATE structure.
hOwner The handle to the hosting main window.
WndProc The window procedure of the new main window.
lParam The parameter will be passed to the window procedure.
Returns:
Handle to the new main window, HWND_INVALID on error.
See also:
DestroyMainWindowIndirect, DialogBoxIndirectParam, DLGTEMPLATE

void GUIAPI DestroyAllControls HWND  hWnd  ) 
 

Destroys all controls in a window.

This function destroys all controls (child windows) in a window.

Parameters:
hWnd The handle to the window.
See also:
DestroyWindow

BOOL GUIAPI DestroyMainWindowIndirect HWND  hMainWin  ) 
 

Destroys a main window created by CreateMainWindowIndirectParam.

This function destroys the main window which was created by CreateMainWindowIndirectParam function.

Parameters:
hMainWin The handle to the main window.
See also:
CreateMainWindowIndirectParam

int GUIAPI DialogBoxIndirectParam PDLGTEMPLATE  pDlgTemplate,
HWND  hOwner,
WNDPROC  DlgProc,
LPARAM  lParam
 

Creates a modal dialog box from a dialog box template in memory.

This function creates a modal dialog box from a dialog box template in memory. Before displaying the dialog box, the function passes an application-defined value to the dialog box procedure as the second parameter of the MSG_INITDIALOG message. An application can use this value to initialize the controls in the dialog box.

Parameters:
pDlgTemplate The pointer to a DLGTEMPLATE structure.
hOwner The handle to the hosting main window.
DlgProc The window procedure of the new dialog box.
lParam The parameter will be passed to the window procedure.
Returns:
Return value of the dialog box, i.e., the second argument passed to EndDialog function which closes the dialog box.
See also:
EndDialog, CreateMainWindowIndirectParam, DLGTEMPLATE
Example:

/*
 * The following code defines the dialog box callback procedure
 * and displays the dialog box by calling DialogBoxIndirectParam function.
 */
static int InitDialogBoxProc (HWND hDlg, int message, WPARAM wParam, LPARAM lParam)
{
    switch (message) {
    case MSG_INITDIALOG:
        return 1;
        
    case MSG_COMMAND:
        switch (wParam) {
        case IDOK:
        case IDCANCEL:
            EndDialog (hDlg, wParam);
            break;
        }
        break;
        
    }
    
    return DefaultDialogProc (hDlg, message, wParam, lParam);
}
static void InitDialogBox (HWND hWnd)
{
    /* Assoiciate the dialog with the controls */
    DlgInitProgress.controls = CtrlInitProgress;
    
    /* Display the dialog box and wait */
    DialogBoxIndirectParam (&DlgInitProgress, hWnd, InitDialogBoxProc, 0L);
}

BOOL GUIAPI EndDialog HWND  hDlg,
int  endCode
 

Destroys a modal dialog box, causing MiniGUI to end any processing for the dialog box.

This function destroys the modal dialog box hDlg created by DialogBoxIndirectParam and ends any processing for the dialog box. The argument endCode will be returned by DialogBoxIndirectParam as the return value.

Parameters:
hDlg The handle to the dialog box.
endCode The value will be returned by DialogBoxIndirectParam.
Returns:
TRUE on success, FALSE on error.
See also:
DialogBoxIndirectParam

int GUIAPI GetDlgCtrlID HWND  hwndCtl  ) 
 

Gets the integer identifier of a control.

This function gets the integer identifier of the control hwndCtl.

Parameters:
hwndCtl The handle to the control.
Returns:
The identifier of the control, -1 for error.
See also:
GetDlgItem

HWND GUIAPI GetDlgDefPushButton HWND  hWnd  ) 
 

Gets the default push button control in a window.

This function gets the handle to the default push button (with BS_DEFPUSHBUTTON style) in the specified window hWnd.

Parameters:
hWnd The handle to the window.
Returns:
The handle to the default push button, zero for non default push button in the window.

HWND GUIAPI GetDlgItem HWND  hDlg,
int  nIDDlgItem
 

Retrives the handle to a control in a dialog box.

This function retrives the handle to a control, whose identifier is nIDDlgItem, in the specified dialog box hDlg.

Parameters:
hDlg The handle to the dialog box.
nIDDlgItem The identifier of the control.
Returns:
The handle to the control, zero for not found.

UINT GUIAPI GetDlgItemInt HWND  hDlg,
int  nIDDlgItem,
BOOL lpTranslated,
BOOL  bSigned
 

Translates the text of a control in a dialog box into an integer value.

This function translates the text of the control, whose identifier is nIDDlgItem in the dialog box hDlg into an integer value.

Parameters:
hDlg The handle to the dialog box.
nIDDlgItem The identifier of the control.
lpTranslated The pointer to a boolean value, which indicates whether translated successfully.
bSigned Indicates whether handle the text as a signed integer.
Returns:
The translated 32-bit integer.
Note:
MiniGUI uses strtol or strtoul to convert the string value to a 32-bit integer, and pass the base as 0. Thus, the valid string value should be in the following forms:
  • [+|-]0x[0-9|A-F]*
    Will be read in base 16.
  • [+|-]0[0-7]*
    Will be read in base 8.
  • [+|-][1-9][0-9]*
    Will be read in base 10.

See also:
GetDlgItemText, SetDlgItemInt

int GUIAPI GetDlgItemText HWND  hDlg,
int  nIDDlgItem,
char *  lpString,
int  nMaxCount
 

Retrieves the title or text associated with a control in a dialog box.

This function retrives the title or text associated with a control, whose identifier is nIDDlgItem in the dialog box hDlg.

Parameters:
hDlg The handle to the dialog box.
nIDDlgItem The identifier of the control.
lpString The pointer to a buffer which receives the text.
nMaxCount The maximal length of the string, not including the null character.
Returns:
The length of the null-terminated text.
Note:
The buffer should at least have size of (nMaxCount + 1).
See also:
GetDlgItemInt, GetDlgItemText2

char *GUIAPI GetDlgItemText2 HWND  hDlg,
int  id,
int *  lenPtr
 

Retrieves the title or text associated with a control in a dialog box.

This function is similiar as GetDlgItemText function, but it allocates memory for the text and returns the pointer to the allocated buffer. You should free the buffer when done by using free function.

Parameters:
hDlg The handle to the dialog box.
id The identifier of the control.
lenPtr The pointer to an integer which receives the length of the text if it is not NULL.
Returns:
The pointer to the allocated buffer.
See also:
GetDlgItemText

HWND GUIAPI GetNextDlgGroupItem HWND  hDlg,
HWND  hCtl,
BOOL  bPrevious
 

Retrieves the handle to the first control in a group of controls that precedes (or follows) the specified control in a dialog box.

This function retrieves the handle to the first control in a group of controls that precedes (or follows) the specified control hCtl in the dialog box hDlg.

Parameters:
hDlg The handle to the dialog box.
hCtl The handle to the control.
bPrevious A boolean value indicates to retrive the preceding or following control. TRUE for preceding control.
Returns:
The handle to the preceding or following control.
See also:
GetNextDlgTabItem

HWND GUIAPI GetNextDlgTabItem HWND  hDlg,
HWND  hCtl,
BOOL  bPrevious
 

Retrieves the handle to the first control that has the WS_TABSTOP style that precedes (or follows) the specified control.

This function retrieves the handle to the first control that has the WS_TABSTOP style that precedes (or follows) the specified control hCtl in the dialog box hDlg.

Parameters:
hDlg The handle to the dialog box.
hCtl The handle to the control.
bPrevious A boolean value indicates to retrive the preceding or following control. TRUE for preceding control.
Returns:
The handle to the preceding or following control.
See also:
GetNextDlgGroupItem

int GUIAPI IsDlgButtonChecked HWND  hDlg,
int  idButton
 

Determines whether a button control has a check mark next to it or whether a three-state button control is grayed, checked, or neither.

This function determines whether the button control whose identifier is idButton has a check mark next to it or whether a three-state button control is grayed, checked, or neither.

Parameters:
hDlg The handle to the dialog box.
idButton The identifier of the button.
Returns:
The check state of the button. If the button is a normal button, the value being zero means the button is checked, otherwise unchecked. If the button is a special button with three states, the value can be one of the following values:
  • BST_UNCHECKED
    The button is unchecked.
  • BST_CHECKED
    The button is checked.
  • BST_INDETERMINATE
    The button is in indeterminate state.
See also:
CheckDlgButton

int GUIAPI SendDlgItemMessage HWND  hDlg,
int  nIDDlgItem,
int  message,
WPARAM  wParam,
LPARAM  lParam
 

Sends a message to the specified control in a dialog box.

This function sends a message specified by (message, wParam, lParam) to the specified control whose identifier is nIDDlgItem in the dialog box hDlg.

Parameters:
hDlg The handle to the dialog box.
nIDDlgItem The identifier of the control.
message The message identifier.
wParam The first message parameter.
lParam The second message parameter.
Returns:
The return value of the message handler.
See also:
SendMessage, GetDlgItem

BOOL GUIAPI SetDlgItemInt HWND  hDlg,
int  nIDDlgItem,
UINT  uValue,
BOOL  bSigned
 

Sets the text of a control in a dialog box to the string representation of a specified integer value.

This function sets the text of the control whose identifier is nIDDlgItem in the dialog box hDlg to the string representation of the specified integer value nValue.

Parameters:
hDlg The handle to the dialog box.
nIDDlgItem The identifier of the control.
uValue The 32-bit integer value.
bSigned A boolean value indicates whether the integer value is a signed integer.
Returns:
TRUE on success, FALSE on error.
See also:
GetDlgItemInt, SetDlgItemText

BOOL GUIAPI SetDlgItemText HWND  hDlg,
int  nIDDlgItem,
const char *  lpString
 

Sets the title or text of a control in a dialog box.

This function sets the title or text of the control whose identifier is nIDDlgItem in the dialog box hDlg to the string pointed to by lpString.

Parameters:
hDlg The handle to the dialog box.
nIDDlgItem The identifier of the control.
lpString The pointer to the string.
Returns:
TRUE on success, FALSE on error.
See also:
GetDlgItemText, SetDlgItemInt


Generated on Mon Jun 26 13:54:33 2006 for MiniGUI V1.6.9 API Reference by  doxygen 1.4.2