window.h
资源名称:GPRS_work.rar [点击查看]
上传用户:sdaoma
上传日期:2013-08-07
资源大小:3838k
文件大小:200k
源码类别:
GPS编程
开发平台:
C/C++
- *
- * sa IsControl, IsWindow
- */
- BOOL GUIAPI IsMainWindow (HWND hWnd);
- /**
- * fn BOOL GUIAPI IsControl (HWND hWnd)
- * brief Determines whether a window is a control.
- *
- * This function determines whether the specified window a hWnd is a control.
- *
- * param hWnd The handle to the window.
- * return TRUE for control, otherwise FALSE.
- *
- * sa IsMainWindow, IsWindow
- */
- BOOL GUIAPI IsControl (HWND hWnd);
- /**
- * fn BOOL GUIAPI IsWindow (HWND hWnd)
- * brief Determines whether a window handle identifies an existing window.
- *
- * This function determines whether the specified window handle a hWnd
- * identifies an existing window.
- *
- * param hWnd The window handle.
- * return TRUE for window, otherwise FALSE.
- *
- * sa IsMainWindow, IsControl
- */
- BOOL GUIAPI IsWindow (HWND hWnd);
- /**
- * fn HWND GUIAPI GetParent (HWND hWnd)
- * brief Retrieves the handle to a child window's parent window.
- *
- * This function retrieves the handle to the specified child window's parent window.
- *
- * param hWnd The handle to the child window.
- * return The handle to the parent, HWND_INVALID indicates an error.
- *
- * note For a main window, this function always returns HWND_DESKTOP.
- *
- * sa GetMainWindowHandle
- */
- HWND GUIAPI GetParent (HWND hWnd);
- /**
- * fn HWND GUIAPI GetMainWindowHandle (HWND hWnd)
- * brief Retrives the handle to the main window contains a window.
- *
- * This function retrives the handle to the main window which contains the
- * specified window a hWnd.
- *
- * param hWnd The handle to the window.
- * return The handle to the main window, HWND_DEKSTOP indicates an error.
- *
- * note For a main window, this function always returns the handle to itself.
- *
- * sa GetParent
- */
- HWND GUIAPI GetMainWindowHandle (HWND hWnd);
- /**
- * fn BOOL GUIAPI IsWindowVisible (HWND hWnd)
- * brief Retrieves the visibility state of a window.
- *
- * This function retrives the visibility state of the specified window a hWnd.
- *
- * param hWnd The handle to the window.
- * return TRUE if visible, otherwise FALSE.
- *
- * sa ShowWindow
- */
- BOOL GUIAPI IsWindowVisible (HWND hWnd);
- /**
- * fn BOOL GUIAPI GetWindowRect (HWND hWnd, PRECT prc)
- * brief Retrives the dimensions of the bounding rectangle of a window.
- *
- * This function retrives the dimension of the bounding rectangle of
- * the specified window a hWnd. The dimensions are given in screen coordinates
- * that are relative to the upper-left corner of the screen.
- *
- * param hWnd The handle to the window.
- * param prc The pointer to a RECT structure which will contains the window rectangle.
- * return TRUE on success, otherwise FALSE.
- *
- * sa GetClientRect
- */
- BOOL GUIAPI GetWindowRect (HWND hWnd, PRECT prc);
- /**
- * fn HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild)
- * brief Retrives the next control in a window.
- *
- * This function retrives the next child of the specified
- * window a hWnd. If you pass HWND_DESKTOP for the argument
- * of a hChild, the function will return the first child of the window.
- *
- * param hWnd The handle to the window.
- * param hChild The handle to a child of the window.
- * return The handle of the next child. If you pass HWND_DESKTOP for
- * the argument of a hChild, it will return the first child
- * of the window. When the child you passed is the last one,
- * this function will return HWND_DESKTOP. If hWnd is not the parent
- * of hChild, this function will return HWND_INVALID.
- *
- * sa GetNextMainWindow
- *
- * Example:
- *
- * include nextcontrol.c
- */
- HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild);
- /**
- * fn HWND GUIAPI GetNextMainWindow (HWND hMainWnd)
- * brief Retrives the next main window in the system.
- *
- * This function retrives the next main window of the specified
- * main window a hMainWnd. If you pass HWND_DESKTOP for the argument
- * of a hChild, the function will return the topmost main window in
- * the system.
- *
- * param hMainWnd The handle to the main window.
- * return The handle of the next main window. If you pass HWND_DESKTOP for
- * the argument of a hMainWnd, it will return the topmost main window.
- * When the main window you passed is the bottommost one, this function
- * will return HWND_DESKTOP. If hMainWnd is not a main window, the function
- * will return HWND_INVALID.
- *
- * sa GetNextChild
- */
- HWND GUIAPI GetNextMainWindow (HWND hMainWnd);
- /**
- * fn HWND GUIAPI GetHosting (HWND hMainWnd)
- * brief Retrives the hosting main window of a main window.
- *
- * This function retrives the hosting main window of the specified
- * main window a hWnd. The hosting main window creates the message queue,
- * which shared with all hosted main window of it.
- *
- * param hMainWnd The handle to the main window.
- * return The handle to the hosting main window.
- *
- * sa GetFirstHosted, GetNextHosted
- */
- HWND GUIAPI GetHosting (HWND hMainWnd);
- /**
- * fn HWND GUIAPI GetFirstHosted (HWND hHosting)
- * brief Retrives the first hosted main window of a main window.
- *
- * This function retrives the first hosted main window of
- * the specified main window a hMainWnd.
- *
- * param hHosting The handle to the hosting main window.
- * return The handle to the first hosted main window.
- *
- * sa GetHosting, GetNextHosted
- */
- HWND GUIAPI GetFirstHosted (HWND hHosting);
- /**
- * fn HWND GUIAPI GetNextHosted (HWND hHosting, HWND hHosted)
- * brief Retrives the next hosted main window of a main window.
- *
- * This function retrives the next hosted main window of the specified
- * main window a hHosting.
- *
- * param hHosting The handle to the hosting main window.
- * param hHosted The handle to a known hosted main window. This function
- * will return the next hosted main window.
- * return Handle to the next hosted main window, HWND_DESKTOP when
- * a hHosted is the last hosted main window.
- *
- * sa GetFirstHosted
- */
- HWND GUIAPI GetNextHosted (HWND hHosting, HWND hHosted);
- /**
- * fn int GUIAPI GetWindowTextLength (HWND hWnd)
- * brief Retrieves the length of a window's text.
- *
- * This function retrieves the length, in characters, of the specified window's text.
- * The function retrieves the length of the text by sending an MSG_GETTEXTLENGTH message
- * to the window.
- *
- * param hWnd The handle to the window.
- * return The length of the window's text.
- *
- * sa GetWindowText
- */
- int GUIAPI GetWindowTextLength (HWND hWnd);
- /**
- * fn int GUIAPI GetWindowText (HWND hWnd, char* spString, int nMaxLen)
- * brief Copies the text of a window's into a buffer.
- *
- * This function copies the text of the specified window a hWnd into the buffer
- * pointed to by a spString. The function gets the window text by sending
- * an MSG_GETTEXT message to the window.
- *
- * param hWnd The handle to the window.
- * param spString The pointer to a buffer receives the text.
- * param nMaxLen The maximal number of characters can be copied to the buffer.
- * return The length of the window text string.
- *
- * sa GetWindowCaption, SetWindowText
- */
- int GUIAPI GetWindowText (HWND hWnd, char* spString, int nMaxLen);
- /**
- * fn BOOL GUIAPI SetWindowText (HWND hWnd, const char* spString)
- * brief Sets the text of a window.
- *
- * This function copies the string in the buffer pointed to by a spString
- * to be the text of the specified window a hWnd. The function sets
- * the window text by sending an MSG_SETTEXT message to the window.
- *
- * param hWnd The handle to the window.
- * param spString The pointer to the buffer.
- * return TRUE on success, otherwise FALSE.
- *
- * sa SetWindowCaption, GetWindowText
- */
- BOOL GUIAPI SetWindowText (HWND hWnd, const char* spString);
- /**
- * fn HWND GUIAPI GetFocusChild (HWND hWnd)
- * brief Retrieves the handle to the window's active child that has the keyboard focus.
- *
- * This function retrives the handle to the window's active child that has
- * the keyboard focus.
- *
- * param hWnd The handle to the window.
- * return The handle to the active child.
- *
- * sa SetFocusChild
- */
- HWND GUIAPI GetFocusChild (HWND hWnd);
- /**
- * fn HWND GUIAPI SetFocusChild (HWND hWnd)
- * brief Sets the active child of a window.
- *
- * This function sets the specified window a hWnd as the active child of its parent.
- *
- * param hWnd The handle to the window.
- * return The handle to the old active child of its parent.
- *
- * sa GetFocusChild
- */
- HWND GUIAPI SetFocusChild (HWND hWnd);
- #define SetFocus SetFocusChild
- #define GetFocus GetFocusChild
- /**
- * fn HWND GUIAPI GetActiveWindow (void)
- * brief Retrieves the main window handle to the active main window.
- *
- * This function retrives the main window handle to the active main window which
- * receives the input.
- *
- * return The handle to the active main window.
- *
- * sa SetActiveWindow, GetFocusChild
- */
- HWND GUIAPI GetActiveWindow (void);
- /**
- * fn HWND GUIAPI SetActiveWindow (HWND hMainWnd)
- * brief Sets a main window to be the active main window.
- *
- * This function sets the specified main window a hMainWnd to be the
- * active main window which receives the input.
- *
- * param hMainWnd The handle to the new active main window.
- * return The handle to the old active main window.
- *
- * sa GetActiveWindow, SetFocusChild
- */
- HWND GUIAPI SetActiveWindow (HWND hMainWnd);
- #define GetForegroundWindow GetActiveWindow
- #define SetForegroundWindow SetActiveWindow
- /**
- * fn HWND GUIAPI GetCapture(void)
- * brief Retrives the handle to the window (if any) that has captured the mouse.
- *
- * This function retrieves the handle to the window (if any) that has captured the mouse.
- * Only one window at a time can capture the mouse; this window receives mouse input
- * whether or not the cursor is within its borders.
- *
- * return The handle to the window that has captured the mouse, HWND_DESKTOP for
- * no window captures the mouse.
- *
- * sa SetCapture
- */
- HWND GUIAPI GetCapture(void);
- /**
- * fn HWND GUIAPI SetCapture(HWND hWnd)
- * brief Sets the mouse capture to the specified window.
- *
- * This function sets the mouse capture to the specified window a hWnd.
- * Once a window has captured the mouse, all mouse input is directed to that window,
- * regardless of whether the cursor is within the borders of that window.
- * Only one window at a time can capture the mouse.
- *
- * param hWnd The handle to the window.
- * return The old capture window.
- *
- * sa GetCapture
- */
- HWND GUIAPI SetCapture(HWND hWnd);
- /**
- * fn void GUIAPI ReleaseCapture(void)
- * brief Releases the mouse capture from a window and restores normal mouse input processing.
- *
- * This function releases the mouse capture from a window and restores normal
- * mouse input processing. A window that has captured the mouse receives all mouse input,
- * regardless of the position of the cursor.
- *
- * sa GetCapture, SetCapture
- */
- void GUIAPI ReleaseCapture(void);
- /**
- * fn BOOL GUIAPI MoveWindow (HWND hWnd, int x, int y, int w, int h, BOOL fPaint)
- * brief Changes the position and dimensions of a window.
- *
- * This function changes the position and dimensions of the specified window a hWnd.
- * For a main window, the position and dimensions are relative to the upper-left
- * corner of the screen. For a control, they are relative to the upper-left
- * corner of the parent window's client area.
- *
- * param hWnd The handle to the window.
- * param x The new x coordinate of the upper-left corner of the window.
- * param y The new y coordinate of the upper-left corner of the window.
- * param w The new width of the window.
- * param h The new height of the window.
- * param fPaint Indicates whether the window should be repainted.
- * return TRUE on success, otherwise FALSE.
- *
- * sa ScrollWindow
- */
- BOOL GUIAPI MoveWindow (HWND hWnd, int x, int y, int w, int h, BOOL fPaint);
- /**
- * fn void GUIAPI ScrollWindow (HWND hWnd, int iOffx, int iOffy, const RECT* rc1, const RECT* rc2)
- * brief Scrolls the content of a window's client area.
- *
- * This function scrolls the content of the specified window's client area.
- *
- * param hWnd The handle to the window.
- * param iOffx The new x coordinate of the origin in the client coordinates system after scrolling.
- * param iOffy The new y coordinate of the origin in the client coordinates system after scrolling.
- * param rc1 The rectangle of the area which will be scroll actually.
- * param rc2 Not used, should be NULL.
- *
- * sa MoveWindow
- */
- void GUIAPI ScrollWindow (HWND hWnd, int iOffx, int iOffy,
- const RECT* rc1, const RECT* rc2);
- #define MWM_MINWIDTH 0
- #define MWM_MINHEIGHT 1
- #define MWM_BORDER 2
- #define MWM_THICKFRAME 3
- #define MWM_THINFRAME 4
- #define MWM_CAPTIONY 5
- #define MWM_ICONX 6
- #define MWM_ICONY 7
- #define MWM_MENUBARY 8
- #define MWM_MENUBAROFFX 9
- #define MWM_MENUBAROFFY 10
- #define MWM_MENUITEMY 11
- #define MWM_INTERMENUITEMX 12
- #define MWM_INTERMENUITEMY 13
- #define MWM_MENUITEMOFFX 14
- #define MWM_MENUTOPMARGIN 15
- #define MWM_MENUBOTTOMMARGIN 16
- #define MWM_MENULEFTMARGIN 17
- #define MWM_MENURIGHTMARGIN 18
- #define MWM_MENUITEMMINX 19
- #define MWM_MENUSEPARATORY 20
- #define MWM_MENUSEPARATORX 21
- #define MWM_SB_HEIGHT 22
- #define MWM_SB_WIDTH 23
- #define MWM_SB_INTERX 24
- #define MWM_CXVSCROLL 25
- #define MWM_CYVSCROLL 26
- #define MWM_CXHSCROLL 27
- #define MWM_CYHSCROLL 28
- #define MWM_MINBARLEN 29
- #define MWM_DEFBARLEN 30
- #define MWM_ITEM_NUMBER 31
- extern int WinMainMetrics [];
- #define GetMainWinMetrics(iItem) (WinMainMetrics[iItem])
- /**
- * fn int GUIAPI GetWindowElementMetricsEx (HWND hwnd, Uint16 item)
- * brief Returns the metrics value of an element of a window.
- *
- * This function returns the metrics value of the specific window element
- * of the window specified by a hwnd.
- *
- * param hwnd The handle to the window. If you pass HWND_DESKTOP for
- * this argument, this function will return the default element metrics.
- * param item The number of the window element, can be one of the following value:
- *
- * return The metrics value of the window element, -1 for error.
- *
- * /sa SetWindowElementMetricsEx
- */
- int GUIAPI GetWindowElementMetricsEx (HWND hwnd, Uint16 item);
- /**
- * fn int GUIAPI SetWindowElementMetricsEx (HWND hwnd, Uint16 item, int new_value)
- * brief Sets the metrics value of an element of a window.
- *
- * This function sets the metrics value of the specific window element of
- * the window specified by a hwnd and returns the old value.
- *
- * param hwnd The handle to the window. If you pass HWND_DESKTOP for
- * this argument, this function will set and return the default element metrics.
- * param item The number of the window element.
- * param new_value The new metrics value of the window element.
- * return The old metrics value of the window element, -1 for error.
- *
- * /sa GetWindowElementMetricsEx
- */
- int GUIAPI SetWindowElementMetricsEx (HWND hwnd, Uint16 item, int new_value);
- #define BKC_CAPTION_NORMAL 0
- #define FGC_CAPTION_NORMAL 1
- #define BKC_CAPTION_ACTIVED 2
- #define FGC_CAPTION_ACTIVED 3
- #define BKC_CAPTION_DISABLED 4
- #define FGC_CAPTION_DISABLED 5
- #define WEC_FRAME_NORMAL 6
- #define WEC_FRAME_ACTIVED 7
- #define WEC_FRAME_DISABLED 8
- #define BKC_MENUBAR_NORMAL 9
- #define FGC_MENUBAR_NORMAL 10
- #define BKC_MENUBAR_HILITE 11
- #define FGC_MENUBAR_HILITE 12
- #define FGC_MENUBAR_DISABLED 13
- #define BKC_MENUITEM_NORMAL 14
- #define FGC_MENUITEM_NORMAL 15
- #define BKC_MENUITEM_HILITE 16
- #define FGC_MENUITEM_HILITE 17
- #define FGC_MENUITEM_DISABLED 18
- #define BKC_PPPMENUTITLE 19
- #define FGC_PPPMENUTITLE 20
- #define FGC_MENUITEM_FRAME 21
- #define WEC_3DBOX_NORMAL 22
- #define WED_3DBOX_REVERSE 23
- #define WEC_3DBOX_LIGHT 24
- #define WEC_3DBOX_DARK 25
- #define WEC_FLAT_BORDER 26
- #define BKC_CONTROL_DEF 27
- #define FGC_CONTROL_NORMAL 28
- #define FGC_CONTROL_DISABLED 29
- #define BKC_HILIGHT_NORMAL 30
- #define BKC_HILIGHT_LOSTFOCUS 31
- #define FGC_HILIGHT_NORMAL 32
- #define FGC_HILIGHT_DISABLED 33
- #define BKC_DESKTOP 34
- #define BKC_DIALOG 35
- #define BKC_TIP 36
- #define WEC_ITEM_NUMBER 37
- /* back compitabilty defines */
- #define BKC_BUTTON_DEF WEC_3DBOX_NORMAL
- #define BKC_BUTTON_PUSHED WEC_3DBOX_DARK
- #define FGC_BUTTON_NORMAL WED_3DBOX_REVERSE
- #define FGC_BUTTON_PUSHED WEC_3DBOX_LIGHT
- #define BKC_EDIT_DEF WEC_3DBOX_LIGHT
- #define BKC_EDIT_DISABLED WEC_3DBOX_NORMAL
- #define WEC_3DFRAME_LEFT_OUTER WED_3DBOX_REVERSE
- #define WEC_3DFRAME_LEFT_INNER WEC_3DBOX_DARK
- #define WEC_3DFRAME_TOP_OUTER WED_3DBOX_REVERSE
- #define WEC_3DFRAME_TOP_INNER WEC_3DBOX_DARK
- #define WEC_3DFRAME_RIGHT_OUTER WEC_3DBOX_LIGHT
- #define WEC_3DFRAME_RIGHT_INNER WEC_3DBOX_NORMAL
- #define WEC_3DFRAME_BOTTOM_OUTER WEC_3DBOX_LIGHT
- #define WEC_3DFRAME_BOTTOM_INNER WEC_3DBOX_NORMAL
- #define WEC_3DFRAME_LEFT WEC_3DBOX_LIGHT
- #define WEC_3DFRAME_TOP WEC_3DBOX_LIGHT
- #define WEC_3DFRAME_RIGHT WEC_3DBOX_DARK
- #define WEC_3DFRAME_BOTTOM WEC_3DBOX_DARK
- extern gal_pixel WinElementColors[];
- #define GetWindowElementColor(iItem) (WinElementColors[iItem])
- /**
- * fn gal_pixel GUIAPI GetWindowElementColorEx (HWND hwnd, Uint16 item)
- * brief Returns the pixel value used to draw the specific window element of a window.
- *
- * This function returns the pixel value used to draw the specific window element
- * of the window specified by a hwnd.
- *
- * param hwnd The handle to the window. If you pass HWND_DESKTOP for
- * this argument, this function will return the default element pixel value.
- * param item The number of window element, can be one of the following values:
- *
- * return The pixel value of the window element.
- *
- * /sa SetWindowElementColorEx
- */
- gal_pixel GUIAPI GetWindowElementColorEx (HWND hwnd, Uint16 item);
- /**
- * fn gal_pixel GUIAPI SetWindowElementColorEx (HWND hwnd, Uint16 item, gal_pixel new_value);
- * brief Sets the pixel value used to draw the specific window element of a window.
- *
- * This function sets the pixel value used to draw the specific window element of
- * the window specified by a hwnd and returns the old pixel value.
- *
- * param hwnd The handle to the window. If you pass HWND_DESKTOP for
- * this argument, this function will set and return the default element pixel value.
- * param item The number of window elment item.
- * param new_value The new pixel value of the window element.
- * return The old pixel value of the window element.
- *
- * /sa GetWindowElementColorEx
- */
- gal_pixel GUIAPI SetWindowElementColorEx (HWND hwnd, Uint16 item, gal_pixel new_value);
- /** @} end of window_general_fns */
- /**
- * defgroup sys_bmps System bitmap/icon operations
- * @{
- */
- #define SYSBMP_CAPBTNS 0
- #define SYSBMP_ARROWS 1
- #define SYSBMP_SCROLLBAR_HBG 2
- #define SYSBMP_SCROLLBAR_HSLIDER 3
- #define SYSBMP_SCROLLBAR_VBG 4
- #define SYSBMP_SCROLLBAR_VSLIDER 5
- #define SYSBMP_BGPICTURE 6
- #define SYSBMP_ITEM_NUMBER 7
- #if defined(_LITE_VERSION) && !defined(_STAND_ALONE)
- /**
- * fn PBITMAP GUIAPI GetSystemBitmap (int id)
- * brief Retrives the system bitmap object by identifier.
- *
- * This function returns the system bitmap object by its identifier.
- *
- * param id The identifier of the system bitmap object, can be
- * one of the following values:
- *
- * - SYSBMP_CAPBTNSn Bitmap of the caption buttons.
- * - SYSBMP_ARROWSn Bitmap of the scroll bar arrows.
- * - SYSBMP_BGPICTUREn Bitmap of the background picture.
- * - SYSBMP_SCROLLBAR_HBGn Bitmap of the background of the horizental scrollbar.
- * - SYSBMP_SCROLLBAR_HSLIDERn Bitmap of the slider of the horizental scrollbar.
- * - SYSBMP_SCROLLBAR_VBGn Bitmap of the background of the vertical scrollbar.
- * - SYSBMP_SCROLLBAR_VSLIDERn Bitmap of the slider of the vertical scrollbar.
- *
- * return The pointer to the system bitmap object.
- *
- * note For MiniGUI-Threads, this function is defined
- * as a macro, and have the same semantics as this function.
- *
- * sa GetLargeSystemIcon, GetSmallSystemIcon
- */
- PBITMAP GUIAPI GetSystemBitmap (int id);
- #else
- extern BITMAP SystemBitmap[];
- #define GetSystemBitmap(iItem) (SystemBitmap + iItem)
- #endif
- #define IDI_APPLICATION 0
- #define IDI_HAND 1
- #define IDI_STOP IDI_HAND
- #define IDI_QUESTION 2
- #define IDI_EXCLAMATION 3
- #define IDI_ASTERISK 4
- #define IDI_INFORMATION IDI_ASTERISK
- #define SYSICO_ITEM_NUMBER 5
- #if defined(_LITE_VERSION) && !defined(_STAND_ALONE)
- /**
- * fn HICON GUIAPI GetLargeSystemIcon (int id)
- * brief Retrives a large system icon by its identifier.
- *
- * This function retrives the handle to a large (32x32) system icon by its identifier a id.
- *
- * param id The identifier of the icon. It can be one of the following values:
- * - IDI_APPLICATIONn The application icon.
- * - IDI_STOPn The stop icon.
- * - IDI_QUESTIONn The question mark icon.
- * - IDI_EXCLAMATIONn The exclamation mark icon.
- * - IDI_INFORMATIONn The information mark icon.
- * return The handle to the icon.
- *
- * note For MiniGUI-Threads, this function is defined
- * as a macro, and have the same semantics as this function.
- *
- * sa GetSystemBitmap
- */
- HICON GUIAPI GetLargeSystemIcon (int id);
- /**
- * fn HICON GUIAPI GetSmallSystemIcon (int id)
- * brief Retrives a small system icon by its identifier.
- *
- * This function retrives the handle to a small (16x16) system icon by its identifier a id.
- *
- * param id The identifier of the icon. It can be one of the following values:
- * - IDI_APPLICATIONn The application icon.
- * - IDI_STOPn The stop icon.
- * - IDI_QUESTIONn The question mark icon.
- * - IDI_EXCLAMATIONn The exclamation mark icon.
- * - IDI_INFORMATIONn The information mark icon.
- * return The handle to the icon.
- *
- * note For MiniGUI-Threads, this function is defined
- * as a macro, and have the same semantics as this function.
- *
- * sa GetSystemBitmap
- */
- HICON GUIAPI GetSmallSystemIcon (int id);
- #else
- extern HICON LargeSystemIcon[];
- #define GetLargeSystemIcon(iItem) (LargeSystemIcon[iItem])
- extern HICON SmallSystemIcon[];
- #define GetSmallSystemIcon(iItem) (SmallSystemIcon[iItem])
- #endif
- #define STOCKBMP_BUTTON "button"
- #define STOCKBMP_PUSHBUTTON "pushbutton"
- #define STOCKBMP_PUSHEDBUTTON "pushedbutton"
- #define STOCKBMP_DOWNARROW "downarrow"
- #define STOCKBMP_UPDOWNARROW "updownarrow"
- #define STOCKBMP_LEFTRIGHTARROW "leftrightarrow"
- #define STOCKBMP_CHECKMARK "checkmark"
- #define STOCKBMP_TRACKBAR_HBG "trackbar_hbg"
- #define STOCKBMP_TRACKBAR_HSLIDER "trackbar_hslider"
- #define STOCKBMP_TRACKBAR_VBG "trackbar_vbg"
- #define STOCKBMP_TRACKBAR_VSLIDER "trackbar_vslider"
- #define STOCKBMP_SPINBOX_HORZ "spinbox_horz"
- #define STOCKBMP_SPINBOX_VERT "spinbox_vert"
- #define STOCKBMP_LVFOLD "lvfold"
- #define STOCKBMP_LVUNFOLD "lvunfold"
- #define STOCKBMP_IMECTRLBTN "IMEctrlbtn"
- #define STOCKBMP_LOGO "logo"
- /**
- * fn const BITMAP* GetStockBitmap (const char* name, int ckey_x, int ckey_y)
- * brief Gets a stock bitmap object.
- *
- * This function gets a stock bitmap object.
- * It will also set the color key of the BITMAP object by using the
- * pixel of (ckey_x, ckey_y) if the pixel is valid when loading the
- * stock bitmap for the first time.
- *
- * param name The key name in the section of "bitmapinfo" in MiniGUI.cfg.
- * param ckey_x The point of (ckey_x, ckey_y) defines the pixel in the bitmap
- * will be used as color key. If either of ckey_x and ckey_y is less than zero,
- * there is no color key.
- * param ckey_y The point of (ckey_x, ckey_y) defines the pixel in the bitmap
- * will be used as color key. If either of ckey_x and ckey_y is less than zero,
- * there is no color key.
- * return NULL on error, else the pointer to the system bitmap.
- *
- * sa LoadSystemBitmapEx, LoadBitmapFromFile, UnloadBitmap
- */
- const BITMAP* GUIAPI GetStockBitmap (const char* name, int ckey_x, int ckey_y);
- /**
- * fn BOOL GUIAPI LoadSystemBitmapEx (PBITMAP pBitmap, const char* szItemName, int ckey_x, int ckey_y)
- * brief Loads a bitmap from information defined in MiniGUI.cfg.
- *
- * This function loads a bitmap from information defined in MiniGUI.cfg.
- * It will also set the color key of the BITMAP object by using the
- * pixel of (ckey_x, ckey_y) if the pixel is valid.
- *
- * param pBitmap The pointer to a bitmap object.
- * param szItemName The key name in the section of "bitmapinfo" in MiniGUI.cfg.
- * param ckey_x The point of (ckey_x, ckey_y) defines the pixel which
- * will be used as color key in the bitmap. If either of ckey_x and ckey_y
- * is less than zero, there is no color key.
- * param ckey_y See ckey_x.
- * return TRUE on success, otherwise FALSE.
- *
- * sa LoadSystemIcon, LoadBitmapFromFile, UnloadBitmap
- */
- BOOL GUIAPI LoadSystemBitmapEx (PBITMAP pBitmap, const char* szItemName, int ckey_x, int ckey_y);
- /**
- * def LoadSystemBitmap(pBitmap, szItemName)
- * brief Loads a bitmap from information defined in MiniGUI.cfg.
- *
- * note Defined as a macro calling a LoadSystemBitmapEx without
- * definition of color key pixel.
- *
- * sa LoadSystemBitmapEx
- */
- #define LoadSystemBitmap(pBitmap, szItemName) LoadSystemBitmapEx (pBitmap, szItemName, -1, -1)
- #define SYSICON_FOLD "fold"
- #define SYSICON_UNFOLD "unfold"
- #define SYSICON_FT_DIR "dir"
- #define SYSICON_FT_FILE "file"
- /**
- * fn HICON GUIAPI LoadSystemIcon (const char* szItemName, int which)
- * brief Loads an icon from information defined in MiniGUI.cfg.
- *
- * This function loads an icon from information defined in MiniGUI.cfg.
- *
- * param szItemName The key name in the section of "iconinfo" in MiniGUI.cfg.
- * param which Tell the function to load which icon.
- * return The handle to the loaded icon.
- *
- * sa LoadSystemBitmap, LoadIconFromFile, DestroyIcon
- */
- HICON GUIAPI LoadSystemIcon (const char* szItemName, int which);
- /** @} end of sys_bmps */
- /**
- * defgroup scrollbar_fns Scroll bar operations
- * @{
- */
- #define SB_HORZ 1
- #define SB_VERT 2
- /**
- * fn BOOL GUIAPI EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable)
- * brief Enables or disables one scroll bar arrows.
- *
- * This function enables or disables one scroll bar arrows.
- *
- * param hWnd The handle to the window.
- * param iSBar Indicates to enable or disable which scroll bar, can be one of
- * the following values:
- * - SB_HORZn
- * The horizontal scroll bar.
- * - SB_VERTn
- * The vertical scroll bar.
- * param bEnable Indicates whether to enable or disable the scroll bar.
- * return TRUE on success, FALSE on error.
- *
- * sa ShowScrollBar
- */
- BOOL GUIAPI EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable);
- /**
- * fn BOOL GUIAPI GetScrollPos (HWND hWnd, int iSBar, int* pPos)
- * brief Retrieves the current position of the scroll box (thumb) in the specified scroll bar.
- *
- * This function retrieves the current position of the scroll box (thumb) in
- * the specified scroll bar. The current position is a relative value that depends
- * on the current scrolling range.
- *
- * param hWnd The handle to the window.
- * param iSBar Indicates to enable or disable which scroll bar, can be one of
- * the following values:
- * - SB_HORZn
- * The horizontal scroll bar.
- * - SB_VERTn
- * The vertical scroll bar.
- * param pPos The pointer to a integer which receives the position value.
- * return TRUE on success, FALSE on error.
- *
- * sa SetScrollPos
- */
- BOOL GUIAPI GetScrollPos (HWND hWnd, int iSBar, int* pPos);
- /**
- * fn BOOL GUIAPI GetScrollRange (HWND hWnd, int iSBar, int* pMinPos, int* pMaxPos)
- * brief Retrives the minimum and maximum position values for the specified scroll bar.
- *
- * This function retrives the minimum and maximum position values for
- * the specified scroll bar.
- *
- * param hWnd The handle to the window.
- * param iSBar Indicates to enable or disable which scroll bar, can be one of
- * the following values:
- * - SB_HORZn
- * The horizontal scroll bar.
- * - SB_VERTn
- * The vertical scroll bar.
- * param pMinPos The pointer to a integer which receives the minimum position value.
- * param pMaxPos The pointer to a integer which receives the maximum position value.
- * return TRUE on success, FALSE on error.
- *
- * sa SetScrollRange
- */
- BOOL GUIAPI GetScrollRange (HWND hWnd, int iSBar, int* pMinPos, int* pMaxPos);
- /**
- * fn BOOL GUIAPI SetScrollPos (HWND hWnd, int iSBar, int iNewPos)
- * brief Sets the position of the scroll box (thumb) in the specified scroll bar.
- *
- * This function sets the position of the scroll box (thumb) in the specified scroll bar,
- * and if needed, redraws the scroll bar to reflect the new position of the scroll box.
- *
- * param hWnd The handle to the window.
- * param iSBar Indicates to enable or disable which scroll bar, can be one of
- * the following values:
- * - SB_HORZn
- * The horizontal scroll bar.
- * - SB_VERTn
- * The vertical scroll bar.
- * param iNewPos The new position value.
- * return TRUE on success, FALSE on error.
- *
- * sa GetScrollPos
- */
- BOOL GUIAPI SetScrollPos (HWND hWnd, int iSBar, int iNewPos);
- /**
- * fn BOOL GUIAPI SetScrollRange (HWND hWnd, int iSBar, int iMinPos, int iMaxPos)
- * brief Sets the minimum and maximum position values for the specified scroll bar.
- *
- * This function sets the minimum and maximum position values for the specified scroll bar,
- * and if needed, redraws the scroll bar to reflect the new position values of the scroll box.
- *
- * param hWnd The handle to the window.
- * param iSBar Indicates to enable or disable which scroll bar, can be one of
- * the following values:
- * - SB_HORZn
- * The horizontal scroll bar.
- * - SB_VERTn
- * The vertical scroll bar.
- * param iMinPos The new minimum position value.
- * param iMaxPos The new maximum position value.
- * return TRUE on success, FALSE on error.
- *
- * sa GetScrollRange
- */
- BOOL GUIAPI SetScrollRange (HWND hWnd, int iSBar, int iMinPos, int iMaxPos);
- /**
- * fn BOOL GUIAPI ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow)
- * brief Shows or hides the specified scroll bar.
- *
- * This function shows or hides the specified scroll bar.
- *
- * param hWnd The handle to the window.
- * param iSBar Indicates to enable or disable which scroll bar, can be one of
- * the following values:
- * - SB_HORZn
- * The horizontal scroll bar.
- * - SB_VERTn
- * The vertical scroll bar.
- * param bShow Indicates whether show or hide the scrollbar.
- * return TRUE on success, FALSE on error.
- *
- * sa EnableScrollBar
- */
- BOOL GUIAPI ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow);
- #define SIF_RANGE 0x0001
- #define SIF_PAGE 0x0002
- #define SIF_POS 0x0004
- #define SIF_DISABLENOSCROLL 0x0008
- #define SIF_TRACKPOS 0x0010
- #define SIF_ALL (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
- /**
- * Scroll bar information structure.
- */
- typedef struct _SCROLLINFO
- {
- /** size of the structrue in bytes */
- UINT cbSize;
- /**
- * a flag indicates which fields contain valid values,
- * can be OR'ed value of the following values:
- * - SIF_RANGEn
- * Retrives or sets the range of the scroll bar.
- * - SIF_PAGEn
- * Retrives or sets the page size of the scroll bar.
- * - SIF_POSn
- * Retrives or sets the position of the scroll bar.
- * - SIF_DISABLENOSCROLLn
- * Hides the scroll when disabled, not implemented so far.
- */
- UINT fMask;
- /** the minimum position value of the scroll bar */
- int nMin;
- /** the maximum position value of the scroll bar */
- int nMax;
- /** the page size of the scroll bar */
- UINT nPage;
- /** the position value of the scroll bar */
- int nPos;
- #if 0
- int nTrackPos;
- #endif
- } SCROLLINFO, *PSCROLLINFO;
- /**
- * fn BOOL GUIAPI SetScrollInfo (HWND hWnd, int iSBar, const SCROLLINFO* lpsi, BOOL fRedraw)
- * brief Sets the parameters of a scroll bar.
- *
- * This function sets the parameters of a scroll bar, including the minimum and maximum
- * scrolling positions, the page size, and the position of the scroll box (thumb).
- * The function also redraws the scroll bar, if requested.
- *
- * param hWnd The handle to the window.
- * param iSBar Indicates to enable or disable which scroll bar, can be one of
- * the following values:
- * - SB_HORZn
- * The horizontal scroll bar.
- * - SB_VERTn
- * The vertical scroll bar.
- * param lpsi The pointer to the structure of scroll bar information.
- * param fRedraw A boolean indicates whether to redraw the scroll bar.
- * return TRUE on success, FALSE on error.
- *
- * sa GetScrollInfo, SCROLLINFO
- */
- BOOL GUIAPI SetScrollInfo (HWND hWnd, int iSBar, const SCROLLINFO* lpsi, BOOL fRedraw);
- /**
- * fn BOOL GUIAPI GetScrollInfo (HWND hWnd, int iSBar, PSCROLLINFO lpsi)
- * brief Retrieves the parameters of a scroll bar.
- *
- * This function retrieves the parameters of a scroll bar, including the minimum
- * and maximum scrolling positions, the page size, and the position of
- * the scroll box (thumb).
- *
- * param hWnd The handle to the window.
- * param iSBar Indicates to enable or disable which scroll bar, can be one of
- * the following values:
- * - SB_HORZn
- * The horizontal scroll bar.
- * - SB_VERTn
- * The vertical scroll bar.
- * param lpsi The pointer to a structure of SCROLLINFO which receives the parameters.
- * return TRUE on success, FALSE on error.
- *
- * sa SetScrollInfo, SCROLLINFO
- */
- BOOL GUIAPI GetScrollInfo (HWND hWnd, int iSBar, PSCROLLINFO lpsi);
- /** @} end of scrollbar_fns */
- /**
- * defgroup class_fns Window class operations
- * @{
- */
- /* Class styles -- not supported so far */
- #define CS_VREDRAW 0x0001
- #define CS_HREDRAW 0x0002
- #define CS_KEYCVTWINDOW 0x0004
- #define CS_DBLCLKS 0x0008
- #define CS_OWNDC 0x0020
- #define CS_CLASSDC 0x0040
- #define CS_PARENTDC 0x0080
- #define CS_NOKEYCVT 0x0100
- #define CS_NOCLOSE 0x0200
- #define CS_SAVEBITS 0x0800
- #define CS_BYTEALIGNCLIENT 0x1000
- #define CS_BYTEALIGNWINDOW 0x2000
- #define CS_GLOBALCLASS 0x4000
- #define CS_IME 0x8000
- #define COP_STYLE 0x0001
- #define COP_HCURSOR 0x0002
- #define COP_BKCOLOR 0x0004
- #define COP_WINPROC 0x0008
- #define COP_ADDDATA 0x0010
- /**
- * Structure defines a window class
- */
- typedef struct _WNDCLASS
- {
- /** the class name */
- char* spClassName;
- /** internal field, operation type */
- DWORD opMask;
- /** window style for all instances of this window class */
- DWORD dwStyle;
- /** extended window style for all instances of this window class */
- DWORD dwExStyle;
- /** cursor handle to all instances of this window class */
- HCURSOR hCursor;
- /** background color pixel value of all instances of this window class */
- int iBkColor;
- /** window callback procedure of all instances of this window class */
- int (*WinProc) (HWND, int, WPARAM, LPARAM);
- /** the private additional data associated with this window class */
- DWORD dwAddData;
- } WNDCLASS;
- typedef WNDCLASS* PWNDCLASS;
- #define MAINWINCLASSNAME ("MAINWINDOW")
- /**
- * fn BOOL GUIAPI RegisterWindowClass (PWNDCLASS pWndClass)
- * brief Registers a window class.
- *
- * This function registers a window class.
- * Later on, you can create a window of a registered class.
- *
- * param pWndClass The pointer to a WNDCLASS structure which specifies
- * the information of the window class.
- * return TRUE on success, FALSE on error.
- *
- * sa UnregisterWindowClass, WNDCLASS
- *
- * Example:
- *
- * include registerwindowclass.c
- */
- BOOL GUIAPI RegisterWindowClass (PWNDCLASS pWndClass);
- /**
- * fn BOOL GUIAPI UnregisterWindowClass (const char* szClassName)
- * brief Undoes the effect of a RegisterWindowClass.
- *
- * This function unregisters a registered window class specified by a szClassName.
- *
- * param szClassName The name of the class to be unregistered.
- * return TRUE on success, FALSE on error.
- *
- * sa RegisterWindowClass
- */
- BOOL GUIAPI UnregisterWindowClass (const char* szClassName);
- /**
- * fn const char* GUIAPI GetClassName (HWND hWnd)
- * brief Retrieves the name of the class to which the specified window belongs.
- *
- * This function retrieves the name of the class to which
- * the specified window a hWnd belongs.
- *
- * param hWnd The handle to the window.
- * return The pointer to a const class name string, NULL on error.
- *
- * sa RegisterWindowClass
- */
- const char* GUIAPI GetClassName (HWND hWnd);
- /**
- * fn BOOL GUIAPI GetWindowClassInfo (PWNDCLASS pWndClass)
- * brief Retrieves the information of the specified window class.
- *
- * This function retrives the information of a window class.
- * The window class to be retrived is specified by a pWndClass->spClassName.
- *
- * param pWndClass The pointer to a WNDCLASS structure, which specifies the
- * window class to be retrived via a spClassName field, and
- * returns the information through other fields.
- * return TRUE on success, FALSE on error.
- *
- * sa SetWindowClassInfo
- */
- BOOL GUIAPI GetWindowClassInfo (PWNDCLASS pWndClass);
- /**
- * fn BOOL GUIAPI SetWindowClassInfo (const WNDCLASS* pWndClass)
- * brief Sets the information of the specified window class.
- *
- * This function sets the information of a window class.
- * The window class to be operated is specified by a pWndClass->spClassName.
- *
- * param pWndClass The pointer to a WNDCLASS structure, which specifies
- * the new information of the window class.
- * return TRUE on success, FALSE on error.
- *
- * sa GetWindowClassInfo
- */
- BOOL GUIAPI SetWindowClassInfo (const WNDCLASS* pWndClass);
- /** @} end of class_fns */
- /**
- * defgroup control_fns Control creating/destroying
- * @{
- */
- /**
- * fn HWND GUIAPI CreateWindowEx (const char* spClassName, const char* spCaption, DWORD dwStyle, DWORD dwExStyle, int id, int x, int y, int w, int h, HWND hParentWnd, DWORD dwAddData)
- * brief Creates a child window with extended style.
- *
- * This function creates a child window (also known as "control") with extended style.
- * It specifies the window class, window title, window style, window extended style,
- * and the initial position and size of the window. The function also specifies
- * the window's parent or owner.
- *
- * param spClassName The class name of the control.
- * param spCaption The caption of the control.
- * param dwStyle The control style.
- * param dwExStyle The extended control style.
- * param id The identifier of the control.
- * param x x,y: The initial position of the control in the parent window.
- * param y x,y: The initial position of the control in the parent window.
- * param w The initial width of the control.
- * param h The initial height of the control.
- * param hParentWnd The handle to the parent window.
- * param dwAddData The first private additional data of the control.
- * Note that some control classes use this value to initialize some properties of
- * the new control instance. For these control classes, you should pass a
- * valid value to it.
- * return The handle to the new control, HWND_INVALID on error.
- *
- * sa CreateMainWindow, CTRLDATA
- *
- * Example:
- *
- * include createwindow.c
- */
- HWND GUIAPI CreateWindowEx (const char* spClassName, const char* spCaption,
- DWORD dwStyle, DWORD dwExStyle, int id,
- int x, int y, int w, int h, HWND hParentWnd, DWORD dwAddData);
- /**
- * fn BOOL GUIAPI DestroyWindow (HWND hWnd)
- * brief Destroys a specified control.
- *
- * This function destroys the specified control a hWnd, which is created
- * by a CreateWindowEx.
- *
- * param hWnd The handle to the control.
- * return TRUE on success, FALSE on error.
- *
- * sa CreateWindowEx
- */
- BOOL GUIAPI DestroyWindow (HWND hWnd);
- /**
- * var typedef void (* NOTIFPROC)(HWND hwnd, int id, int nc, DWORD add_data)
- * brief Type of the notification callback procedure.
- *
- * This is the function type of Notification Callback Procedure.
- * If you set the Notification Callback Procedure for a control,
- * when a notification occurred the control will call this callback
- * procedure.
- *
- * sa SetNotificationCallback
- */
- typedef void (* NOTIFPROC) (HWND hwnd, int id, int nc, DWORD add_data);
- /**
- * fn NOTIFPROC GUIAPI SetNotificationCallback (HWND hwnd, NOTIFPROC notif_proc)
- * brief Sets a new notification callback procedure for a control.
- *
- * This function sets the new notification callback procedure (a notif_proc)
- * for the control of a hwnd.
- *
- * By default, the notification from a control will be sent to its parent
- * window within a MSG_COMMAND messsage.
- *
- * Since version 1.2.6, MiniGUI defines the Notification Callback Procedure
- * for control. You can specify a callback function for a control by calling
- * a SetNotificationCallback to receive and handle the notification from
- * the control.
- *
- * If you did not set the notification callback function for a control,
- * the notification will be sent to its parent as same as the earlier
- * version of MiniGUI.
- *
- * param hwnd The handle to the control.
- * param notif_proc The new notification callback procedure, can be NULL.
- * return The old notification callback procedure.
- *
- * sa NOTIFPROC, GetNotificationCallback
- */
- NOTIFPROC GUIAPI SetNotificationCallback (HWND hwnd, NOTIFPROC notif_proc);
- /**
- * fn NOTIFPROC GUIAPI GetNotificationCallback (HWND hwnd)
- * brief Gets the notification callback procedure of a control.
- *
- * This function gets the new notification callback procedure of
- * the control of a hwnd.
- *
- * param hwnd The handle to the control.
- * return The notification callback procedure.
- *
- * sa NOTIFPROC, SetNotificationCallback
- */
- NOTIFPROC GUIAPI GetNotificationCallback (HWND hwnd);
- /**
- * def CreateWindow(class_name, caption, style, id, x, y, w, h, parent, add_data)
- * brief A simplified version of a CreateWindowEx.
- *
- * sa CreateWindowEx
- */
- #define CreateWindow(class_name, caption, style, id, x, y, w, h, parent, add_data)
- CreateWindowEx(class_name, caption, style, 0, id, x, y, w, h, parent, add_data)
- /** @} end of control_fns */
- /******************************** Timer Support ******************************/
- /**
- * defgroup timer_fns Timer operations
- * @{
- */
- /**
- * fn BOOL GUIAPI SetTimer (HWND hWnd, int id, unsigned int speed)
- * brief Creates a timer with the specified timeout value.
- *
- * This function creates a timer with the specified timeout value a speed.
- * By default, the timeout value is in unit of 10 ms.
- * When the timer expires, an MSG_TIMER message will be send to the window a hWnd.
- *
- * param hWnd The window receives the MSG_TIMER message.
- * param id The identifier of the timer, will be passed to the window
- * with MSG_TIMER message as the first parameter of the message.
- * param speed The timeout value of the timer. By default, the timeout value is in unit of 10 ms.
- * return TRUE on success, FALSE on error.
- *
- * note The argument a speed may represent the frequency of the timer,
- * or represent the timeout value of the timer. This is depend on
- * the runtime library of MiniGUI. If a _TIMER_UNIT_10MS is defined,
- * a speed represents the timeout value of the timer, in the unit of 10ms,
- * else is the frequency. If a speed represents the frequency of the timer,
- * when it is equal to 10, the timer will expire after every second.
- *
- * sa KillTimer, MSG_TIMER
- *
- * Example:
- *
- * include settimer.c
- */
- BOOL GUIAPI SetTimer (HWND hWnd, int id, unsigned int speed);
- /**
- * fn BOOL GUIAPI KillTimer (HWND hWnd, int id)
- * brief Destroys a timer.
- *
- * This function destroys the specified timer a id.
- *
- * param hWnd The window owns the timer.
- * param id The identifier of the timer.
- * return TRUE on success, FALSE on error.
- *
- * sa SetTimer
- */
- BOOL GUIAPI KillTimer (HWND hWnd, int id);
- /**
- * fn BOOL GUIAPI ResetTimer (HWND hWnd, int id, unsigned int speed)
- * brief Adjusts a timer with a different timeout value.
- *
- * This function resets a timer with the specified timeout a speed value.
- *
- * param hWnd The window owns the timer.
- * param id The identifier of the timer.
- * param speed The new timeout value.
- * return TRUE on success, FALSE on error.
- *
- * sa SetTimer
- */
- BOOL GUIAPI ResetTimer (HWND hWnd, int id, unsigned int speed);
- /**
- * fn unsigned int GUIAPI GetTickCount (void)
- * brief Retrieves the tick counts that have elapsed since MiniGUI was started.
- *
- * This function retrieves the tick counts that
- * have elapsed since MiniGUI was started. It is limited to the
- * resolution of the system timer, i.e. for a general Linux box,
- * the returned tick count value is in unit of 10ms.
- *
- * return The tick counts value that have elapsed since MiniGUI was started.
- */
- unsigned int GUIAPI GetTickCount (void);
- /** @} end of timer_fns */
- /**
- * defgroup ime_fns IME Window functions
- * @{
- */
- #ifdef _IME_GB2312
- /**
- * fn int GBIMEWinProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
- * brief The window callback procedure of the builit-in GB2312 Input Method window.
- *
- * This function is the window callback procedure of the built-in GB2312 (a charset
- * for simplified Chinese) Input Method window.
- *
- * note This function defined for _IME_GB2312. You can disable GB2312 IME support
- * by using
- * code
- * ./configure --disable-imegb2312
- * endcode
- *
- * sa GBIMEWindowEx
- */
- int GBIMEWinProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
- #ifdef _LITE_VERSION
- /**
- * fn HWND GBIMEWindowEx (HWND hosting, int lx, int ty, int rx, int by, BOOL two_lines)
- * brief Creates a GB2312 input method window.
- *
- * This function creates a GB2312 (a charset for simplified Chinese) input method window.
- * Before calling this window, you must create a main window which acts as the hosting
- * main window of the IME window.
- *
- * param hosting The hosting window of the IME window. Do not set it to be HWND_DESKTOP.
- * param lx lx,ty,rx,by: The position and size of the IME window.
- * param ty lx,ty,rx,by: The position and size of the IME window.
- * param rx lx,ty,rx,by: The position and size of the IME window.
- * param by lx,ty,rx,by: The position and size of the IME window.
- * param two_lines Indicates whether the IME window contains two lines.
- * return The handle to the IME window.
- *
- * note This function only define for MiniGUI-Lite.
- *
- * sa GBIMEWindow
- */
- HWND GBIMEWindowEx (HWND hosting, int lx, int ty, int rx, int by, BOOL two_lines);
- /**
- * def GBIMEWindow (hosting)
- * brief The simplified version of a GBIMEWindowEx.
- *
- * param hosting The hosting window of the IME window. Do not set it to be HWND_DESKTOP.
- * return The handle to the IME window.
- *
- * note For MiniGUI-Threads, a GBIMEWindow defined as a function:
- *
- * code
- * HWND GBIMEWindow (HWND hosting);
- * endcode
- *
- * Calling this function will create a thread and start the GB2312 IME window in this thread.
- *
- * sa GBIMEWindowEx
- */
- #define GBIMEWindow(hosting) GBIMEWindowEx(hosting, 0, 0, 0, 0, TRUE)
- #else
- HWND GBIMEWindow (HWND hosting);
- #endif
- #endif
- /**
- * fn int GUIAPI RegisterIMEWindow (HWND hWnd)
- * brief Registers an IME window.
- *
- * This function registers the specified window a hWnd as the IME window of the MiniGUI.
- * After that, the keyboard input will be sent to IME window first. Note that only one
- * IME window can be registered.
- *
- * param hWnd The handle to your IME window.
- * return ERR_OK on success, otherwise less than zero.
- *
- * retval ERR_OK Success.
- * retval ERR_IME_TOOMUCHIMEWND Already have an IME window registered.
- * retval ERR_INV_HWND Invalid main window handle.
- *
- * sa UnregisterIMEWindow
- */
- int GUIAPI RegisterIMEWindow (HWND hWnd);
- /**
- * fn int GUIAPI UnregisterIMEWindow (HWND hWnd)
- * brief Unregisters an IME window.
- *
- * This function undoes the effect of a RegisterIMEWindow.
- *
- * param hWnd The handle to the current IME window.
- * return ERR_OK on success, otherwise less than zero.
- *
- * retval ERR_OK Success.
- * retval ERR_IME_NOSUCHIMEWND The window is not the current IME window.
- *
- * sa RegisterIMEWindow
- */
- int GUIAPI UnregisterIMEWindow (HWND hWnd);
- /**
- * fn int GUIAPI GetIMEStatus (int StatusCode)
- * brief Retrives status of the current IME window.
- *
- * This function retrives status of the current IME window.
- *
- * param StatusCode The item to be retrived, can be one of the following values:
- * - IS_ENABLEn
- * Is the IME window enabled?
- * - IS_FULLCHARn
- * Whether translate half character to full character?
- * - IS_FULLPUNCn
- * Whether tranlsate half punctuate mark to full mark?
- * - IS_METHODn
- * Which input method?
- * return The status of the item specified by a StatusCode,
- * ERR_IME_NOIMEWND if error occurred.
- *
- * sa SetIMEStatus
- */
- int GUIAPI GetIMEStatus (int StatusCode);
- /**
- * fn int GUIAPI SetIMEStatus (int StatusCode, int Value)
- * brief Sets the status of the current IME window.
- *
- * This function sets the status of the current IME window.
- *
- * param StatusCode The item to be set, can be one of the following values:
- * - IS_ENABLEn
- * Enabled or disable IME window.
- * - IS_FULLCHARn
- * Whether translate half character to full character?
- * - IS_FULLPUNCn
- * Whether tranlsate half punctuate mark to full mark?
- * - IS_METHODn
- * Which input method?
- * param Value The status value of the item.
- * return ERR_OK on success, otherwise less than zero.
- *
- * retval ERR_OK Success.
- * retval ERR_IME_NOIMEWND There is no any IME window registered.
- *
- * sa GetIMEStatus
- */
- int GUIAPI SetIMEStatus (int StatusCode, int Value);
- /** @} end of ime_fns */
- /**
- * defgroup accel_fns Accelerator operations
- * @{
- */
- /**
- * fn HACCEL GUIAPI CopyAcceleratorTable (HACCEL hacc)
- * brief Copies the specified accelerator table.
- *
- * This function copies the specified accelerator table.
- * The function is used to obtain the accelerator table data that
- * corresponds to an accelerator table handle.
- *
- * param hacc The handle to the accelerator table.
- * return The handle to the copied new accelerator table.
- */
- HACCEL GUIAPI CopyAcceleratorTable (HACCEL hacc);
- /**
- * fn int GUIAPI DeleteAccelerators (HACCEL hacc, int key, DWORD keymask)
- * brief Deletes an accelerator from the accelerator table.
- *
- * This function deletes an accelerator from the accelerator table.
- *
- * param hacc The handle to the accelerator table.
- * param key The key value of the accelerator.
- * param keymask The shift key state.
- * return The function returns 0 for success, non-zero for failure.
- *
- * sa AddAccelerators, DestroyAcceleratorTable
- */
- int GUIAPI DeleteAccelerators (HACCEL hacc, int key, DWORD keymask);
- #define ACCEL_SHIFT KS_SHIFT
- #define ACCEL_ALT KS_ALT
- #define ACCEL_CTRL KS_CTRL
- /**
- * fn int GUIAPI AddAccelerators (HACCEL hacc, int key, DWORD keymask, WPARAM wParam, LPARAM lParam)
- * brief Adds an accelerator to the accelerator table.
- *
- * This function adds an accelerator to the accelerator table.
- * It's called after you call a CreateAcceleratorTable function.
- *
- * param hacc The handle to the accelerator table.
- * param key The key value of the accelerator. Note that you can define the key value by
- * either scancode or ASCII code. If you define the key with scancode,
- * the key value should be equal to (scancode + 256).
- * param keymask The shift key state, can be OR'ed value of the following values:
- * - ACCEL_SHIFTn
- * Shift key should be pressed.
- * - ACCEL_ALTn
- * Alt key should be pressed.
- * - ACCEL_CTRLn
- * Ctrl key should be pressed.
- * param wParam The first parameter of the MSG_COMMAND when receiving such a accelerator key.
- * param lParam The second parameter of the MSG_COMMAND when receiving such a accelerator key.
- * return The function returns 0 for success, non-zero for failure.
- *
- * sa CreateAcceleratorTable, DeleteAccelerators
- */
- int GUIAPI AddAccelerators (HACCEL hacc,
- int key, DWORD keymask, WPARAM wParam, LPARAM lParam);
- /**
- * fn int GUIAPI DestroyAcceleratorTable (HACCEL hacc)
- * brief Destroies an accelerator table.
- *
- * This function destroys the specified accelerator table a hacc.
- * Before closing a window, you must call this function to destroy
- * each accelerator table that is created by using a CreateAcceleratorTable
- * function.
- *
- * param hacc The handle to the accelerator table.
- * return The function returns 0 for success, non-zero for failure.
- *
- * sa CreateAcceleratorTable
- */
- int GUIAPI DestroyAcceleratorTable (HACCEL hacc);
- /**
- * fn HACCEL GUIAPI CreateAcceleratorTable (HWND hWnd)
- * brief Creates an empty accelerator table.
- *
- * This function creates an empty accelerator table.
- *
- * param hWnd The handle to the main window.
- * return The handle to the new accelerator table, zero when error.
- *
- * sa AddAccelerators, DestroyAcceleratorTable
- */
- HACCEL GUIAPI CreateAcceleratorTable (HWND hWnd);
- /**
- * fn HACCEL GUIAPI LoadAccelerators (const char* filename, int id)
- * brief Loads an accelerator table from an external file.
- *
- * This function loads an accelerator table from an external file.
- *
- * param filename The path name of the file.
- * param id The identifier of the accelerator table.
- * return The handle to the accelerator table, zero when error.
- *
- * note The function is not implemented so far.
- */
- HACCEL GUIAPI LoadAccelerators (const char* filename, int id);
- /**
- * fn int GUIAPI TranslateAccelerator (HWND hWnd, HACCEL hAccel, PMSG pMsg)
- * brief Translates an accelerator key message to MSG_COMMAND messge
- * and sends it to the window procedure.
- *
- * param hWnd The handle to the window.
- * param hAccel The handle to the accelerator table.
- * param pMsg The pointer to the MSG structure to be translated.
- * return The function returns 0 for success, non-zero for failure.
- *
- * sa TranslateMessage
- */
- int GUIAPI TranslateAccelerator (HWND hWnd, HACCEL hAccel, PMSG pMsg);
- /** @} end of accel_fns */
- /**
- * defgroup caret_fns Caret operations
- * @{
- */
- /**
- * fn BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight)
- * brief Creates a new shape for the system caret and assigns ownership of the caret to
- * the specified window.
- *
- * This function creates a new shape for the system caret and assigns ownership of
- * the caret to the specified window a hWnd. The caret shape can be a line,
- * a block, or a bitmap.
- *
- * param hWnd The owner of the caret.
- * param pBitmap The bitmap shape of the caret.
- * param nWidth The width of the caret.
- * param nHeight The height of the caret.
- * return TRUE on success, otherwise FALSE.
- *
- * sa ActiveCaret, ChangeCaretSize
- */
- BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight);
- /**
- * fn BOOL GUIAPI ChangeCaretSize (HWND hWnd, int newWidth, int newHeight)
- * brief Changes the size of the caret.
- *
- * This function change the size of the caret owned by the specified window
- * a hWnd. Note that the new size of the caret should be smaller than
- * the original size which is specified when you call a CreateCaret.
- *
- * param hWnd The owner of the caret.
- * param newWidth The new width of the caret.
- * param newHeight The new height of the caret.
- * return TRUE on success, otherwise FALSE.
- *
- * sa CreateCaret
- */
- BOOL GUIAPI ChangeCaretSize (HWND hWnd, int newWidth, int newHeight);
- /**
- * fn BOOL GUIAPI ActiveCaret (HWND hWnd)
- * brief Activates the caret owned by specified window.
- *
- * This function activates the caret owned by specified window a hWnd.
- * After activating the caret, the caret will begin flashing automatically.
- *
- * param hWnd The owner of the caret.
- * return TRUE on success, otherwise FALSE.
- *
- * sa HideCaret, ShowCaret
- */
- BOOL GUIAPI ActiveCaret (HWND hWnd);
- /**
- * fn UINT GUIAPI GetCaretBlinkTime (HWND hWnd)
- * brief Returns the elapsed time, in milliseconds, required to invert the caret's pixels.
- *
- * This function returns the elapsed time, in milliseconds, required to
- * invert the caret's pixels. The default blink time of a caret is 500 milliseconds.
- *
- * param hWnd The owner of the caret.
- * return The elapsed time in milliseconds. Returns zero on error.
- *
- * sa SetCaretBlinkTime
- */
- UINT GUIAPI GetCaretBlinkTime (HWND hWnd);
- /**
- * fn BOOL GUIAPI SetCaretBlinkTime (HWND hWnd, UINT uTime)
- * brief Sets the caret blink time to the specified number of milliseconds.
- *
- * This function sets the caret blink time to the specified number of milliseconds.
- * The blink time is the elapsed time, in milliseconds, required to
- * invert the caret's pixels. The default blink time of a caret is 500 milliseconds.
- *
- * param hWnd The owner of the caret.
- * param uTime New blink time in milliseconds.
- * return TRUE on success, otherwise FALSE.
- *
- * sa GetCaretBlinkTime
- */
- BOOL GUIAPI SetCaretBlinkTime (HWND hWnd, UINT uTime);
- /**
- * fn BOOL GUIAPI DestroyCaret (HWND hWnd)
- * brief Destroys a caret.
- *
- * This function destroys the caret's current shape,
- * frees the caret from the window, and removes the caret from the screen.
- *
- * param hWnd The owner of the caret.
- * return TRUE on success, otherwise FALSE.
- *
- * sa CreateCaret
- */
- BOOL GUIAPI DestroyCaret (HWND hWnd);
- /**
- * fn BOOL GUIAPI HideCaret (HWND hWnd)
- * brief Hides a caret.
- *
- * This function removes the caret from the screen.
- * Hiding a caret does not destroy its current shape or invalidate the insertion point.
- *
- * param hWnd The owner of the caret.
- * return TRUE on success, otherwise FALSE.
- *
- * sa ShowCaret
- */
- BOOL GUIAPI HideCaret (HWND hWnd);
- /**
- * fn BOOL GUIAPI ShowCaret (HWND hWnd)
- * brief Shows a caret.
- *
- * This function makes the caret visible on the screen
- * at the caret's current position. When the caret becomes visible,
- * it begins flashing automatically.
- *
- * param hWnd The owner of the caret.
- * return TRUE on success, otherwise FALSE.
- *
- * sa HideCaret
- */
- BOOL GUIAPI ShowCaret (HWND hWnd);
- /**
- * fn BOOL GUIAPI SetCaretPos (HWND hWnd, int x, int y)
- * brief Moves the caret to a new position.
- *
- * This function moves the caret to the specified coordinates a (x,y).
- *
- * param hWnd The owner of the caret.
- * param x x,y: The position of the caret in client coordiantes.
- * param y x,y: The position of the caret in client coordiantes.
- * return TRUE on success, otherwise FALSE.
- *
- * sa GetCaretPos
- */
- BOOL GUIAPI SetCaretPos (HWND hWnd, int x, int y);
- /**
- * fn BOOL GUIAPI GetCaretPos (HWND hWnd, PPOINT pPt)
- * brief Gets the caret position.
- *
- * This function copies the caret's position, in client coordinates,
- * to the specified POINT structure a pPt.
- *
- * param hWnd The owner of the caret.
- * param pPt The pointer to the buffer saves the caret's position.
- * return TRUE on success, otherwise FALSE.
- *
- * sa SetCaretPos
- */
- BOOL GUIAPI GetCaretPos (HWND hWnd, PPOINT pPt);
- /** @} end of caret_fns */
- /**
- * defgroup menu_fns Menu operations
- * @{
- */
- /* Menu flags */
- #define MF_INSERT 0x00000000L
- #define MF_CHANGE 0x00000080L
- #define MF_APPEND 0x00000100L
- #define MF_DELETE 0x00000200L
- #define MF_REMOVE 0x00001000L
- #define MF_BYCOMMAND 0x00000000L
- #define MF_BYPOSITION 0x00000400L
- #define MF_SEPARATOR 0x00000800L
- #define MF_ENABLED 0x00000000L
- #define MF_GRAYED 0x00000001L
- #define MF_DISABLED 0x00000002L
- #define MF_UNCHECKED 0x00000000L
- #define MF_CHECKED 0x00000008L
- #define MF_USECHECKBITMAPS 0x00000200L
- #define MF_STRING 0x00000000L
- #define MF_BITMAP 0x00000004L
- #define MF_OWNERDRAW 0x00000100L
- #define MF_POPUP 0x00000010L
- #define MF_MENUBARBREAK 0x00000020L
- #define MF_MENUBREAK 0x00000040L
- #define MF_UNHILITE 0x00000000L
- #define MF_HILITE 0x00000080L
- #define MF_DEFAULT 0x00001000L
- #define MF_SYSMENU 0x00002000L
- #define MF_HELP 0x00004000L
- #define MF_RIGHTJUSTIFY 0x00004000L
- #define MF_MOUSESELECT 0x00008000L
- #define MF_END 0x00000080L
- #define MFT_STRING MF_STRING
- #define MFT_BITMAP MF_BITMAP
- #define MFT_BMPSTRING 0x00010000L
- #define MFT_MENUBARBREAK MF_MENUBARBREAK
- #define MFT_MENUBREAK MF_MENUBREAK
- #define MFT_OWNERDRAW MF_OWNERDRAW
- #define MFT_RADIOCHECK 0x00000200L
- #define MFT_SEPARATOR MF_SEPARATOR
- #define MFT_RIGHTORDER 0x00002000L
- #define MFT_RIGHTJUSTIFY MF_RIGHTJUSTIFY
- #define MFS_GRAYED 0x00000003L
- #define MFS_DISABLED MFS_GRAYED
- #define MFS_CHECKED MF_CHECKED
- #define MFS_HILITE MF_HILITE
- #define MFS_ENABLED MF_ENABLED
- #define MFS_UNCHECKED MF_UNCHECKED
- #define MFS_UNHILITE MF_UNHILITE
- #define MFS_DEFAULT MF_DEFAULT
- /* System Menu Command Values */
- #define SC_SIZE 0xF000
- #define SC_MOVE 0xF010
- #define SC_MINIMIZE 0xF020
- #define SC_MAXIMIZE 0xF030
- #define SC_NEXTWINDOW 0xF040
- #define SC_PREVWINDOW 0xF050
- #define SC_CLOSE 0xF060
- #define SC_VSCROLL 0xF070
- #define SC_HSCROLL 0xF080
- #define SC_MOUSEMENU 0xF090
- #define SC_KEYMENU 0xF100
- #define SC_ARRANGE 0xF110
- #define SC_RESTORE 0xF120
- #define SC_TASKLIST 0xF130
- #define SC_SCREENSAVE 0xF140
- #define SC_HOTKEY 0xF150
- #define SC_DEFAULT 0xF160
- #define SC_MONITORPOWER 0xF170
- #define SC_CONTEXTHELP 0xF180
- #define SC_SEPARATOR 0xF00F
- /* MENUITEMINFO flags */
- #define MIIM_STATE 0x00000001
- #define MIIM_ID 0x00000002
- #define MIIM_SUBMENU 0x00000004
- #define MIIM_CHECKMARKS 0x00000008
- #define MIIM_TYPE 0x00000010
- #define MIIM_DATA 0x00000020
- #define MIIM_STRING 0x00000040
- #define MIIM_BITMAP 0x00000080
- #define MIIM_FTYPE 0x00000100
- /* Flags for TrackPopupMenu */
- #define TPM_LEFTBUTTON 0x0000L
- #define TPM_RIGHTBUTTON 0x0002L
- #define TPM_LEFTALIGN 0x0000L
- #define TPM_CENTERALIGN 0x0004L
- #define TPM_RIGHTALIGN 0x0008L
- #define TPM_TOPALIGN 0x0000L
- #define TPM_VCENTERALIGN 0x0010L
- #define TPM_BOTTOMALIGN 0x0020L
- #define TPM_HORIZONTAL 0x0000L /* Horz alignment matters more */
- #define TPM_VERTICAL 0x0040L /* Vert alignment matters more */
- #define TPM_NONOTIFY 0x0080L /* Don't send any notification msgs */
- #define TPM_RETURNCMD 0x0100L
- #define TPM_DESTROY 0x1000L /* Destroy menu after tracking */
- #define TPM_SYSCMD 0x2000L /* Send system command */
- #define TPM_DEFAULT 0x0000L /* Default tracking flag */
- /* return codes for MSG_MENUCHAR */
- #define MNC_IGNORE 0
- #define MNC_CLOSE 1
- #define MNC_EXECUTE 2
- #define MNC_SELECT 3
- /**
- * Structure defines a menu item
- */
- typedef struct _MENUITEMINFO {
- /**
- * used by a GetMenuItemInfo and a SetMenuItemInfo functions,
- * can be OR'ed with the following values:
- * - MIIM_STATEn
- * Get/set the state of the menu item.
- * - MIIM_IDn
- * Get/set the identifier of the menu item.
- * - MIIM_SUBMENUn
- * Get/set the sub-menu of the menu item.
- * - MIIM_CHECKMARKSn
- * Get/set the check/uncheck bitmap.
- * - MIIM_TYPEn
- * Get/set the type and the type data of the menu item.
- * - MIIM_DATAn
- * Get/set the item data of the menu item.
- */
- UINT mask;
- /**
- * type of menu item, can be one of the following values:
- * - MFT_STRINGn
- * A normal string menu item.
- * - MFT_BITMAPn
- * A bitmap menu item.
- * - MFT_BMPSTRINGn
- * A bitmap menu item followed by a string.
- * - MFT_SEPARATOR
- * A separator in menu.
- * - MFT_RADIOCHECKn
- * A normal string with a radio check mark.
- */
- UINT type;
- /**
- * state of the menu item, can be one of the following values:
- * - MFS_GRAYEDn
- * The menu item is disabled.
- * - MFS_DISABLEDn
- * The menu item is disabled.
- * - MFS_CHECKEDn
- * The menu item is checked.
- * - MFS_ENABLEDn
- * The menu item is enabled.
- * - MFS_UNCHECKEDn
- * The menu item is unchecked.
- */
- UINT state;
- /** the identifier of the menu item */
- int id;
- /** the handle to the sub-menu if this menu contains a sub menu */
- HMENU hsubmenu;
- /** the pointer to a BITMAP object used for checked bitmap menu item */
- PBITMAP hbmpChecked;
- /** the pointer to a BITMAP object used for unchecked bitmap menu item */
- PBITMAP hbmpUnchecked;
- /** the private data attached to the menu item */
- DWORD itemdata;
- /** the data of this menu item, used to pass the string of the menu item */
- DWORD typedata;
- /** used by a GetMenuItemInfo function to indicate the maximal length of the string */
- UINT cch;
- } MENUITEMINFO;
- typedef MENUITEMINFO* PMENUITEMINFO;
- /**
- * fn HMENU GUIAPI LoadMenuFromFile (const char* filename, int id)
- * brief Loads a menu from an external file.
- *
- * This function loads a menu from an external file.
- *
- * param filename The path name of the file.
- * param id The identifier of the menu.
- * return The handle to the menu, zero when error.
- *
- * note The function is not implemented so far.
- */
- HMENU GUIAPI LoadMenuFromFile (const char* filename, int id);
- /**
- * fn HMENU GUIAPI CreateMenu (void)
- * brief Creates an empty menu.
- *
- * This function creates a menu. The menu is initially empty, but it can be
- * filled with menu items by using the a InsertMenuItem functions.
- *
- * return The handle to the menu, zero when error.
- *
- * sa InsertMenuItem
- */
- HMENU GUIAPI CreateMenu (void);
- /**
- * fn HMENU GUIAPI CreatePopupMenu ( PMENUITEMINFO pmii)
- * brief Creates a drop-down menu or submenu.
- *
- * This function creates a drop-down menu or submenu. The menu is initially empty.
- * You can insert or append menu items by using the a InsertMenuItem function.
- *
- * param pmii Menu item information used to create the popup menu.
- * return The handle to the popup menu.
- *
- * sa InsertMenuItem, MENUITEMINFO
- */
- HMENU GUIAPI CreatePopupMenu ( PMENUITEMINFO pmii);
- /**
- * fn HMENU GUIAPI CreateSystemMenu (HWND hwnd, DWORD dwStyle)
- * brief Creates a system menu.
- *
- * This function creates a system menu for the main window specified by a hwnd.
- *
- * param hwnd The handle to the main window.
- * param dwStyle The main window style.
- * return The handle to the system menu.
- *
- * sa CreateMenu, CreatePopupMenu
- */
- HMENU GUIAPI CreateSystemMenu (HWND hwnd, DWORD dwStyle);
- /**
- * fn int GUIAPI InsertMenuItem (HMENU hmnu, int item, BOOL flag, PMENUITEMINFO pmii)
- * brief Inserts a new menu item at the specified position in a menu.
- *
- * This function inserts a new menu item specified by a pmmi at the
- * specified position (determined by a item and a flag) in the menu a hmnu.
- *
- * param hmnu The handle to the menu.
- * param item The insertion position.
- * param flag Indicates the position base, can be one of the following values:
- * - MF_BYCOMMANDn
- * The position value a item is based on the command identifier.
- * The new menu item will insert bellow the item whose id is a item.
- * - MF_BYPOSITIONn
- * The position value a item is based on the position in the menu.
- * param pmii Menu item information used to create the popup menu.
- *
- * return The function returns 0 for success, non-zero for failure.
- *
- * retval ERR_INVALID_HANDLE a hmnu is not a handle to menu.
- * retval ERR_RES_ALLOCATION Can not allocate new menu item.
- * retval ERR_INVALID_HMENU a hmnu is an invalid menu.
- *
- * sa RemoveMenu, MENUITEMINFO
- */
- int GUIAPI InsertMenuItem (HMENU hmnu, int item,
- BOOL flag, PMENUITEMINFO pmii);
- /**
- * fn int GUIAPI RemoveMenu (HMENU hmnu, int item, UINT flag)
- * brief Deletes a menu item or detaches a submenu from the specified menu.
- *
- * This function deletes a menu item or detaches a submenu from the specified menu a hmnu.
- * If the item is a normal menu item, the function will delete the item.
- * If the item is a submenu, the function will detache the submenu for the menu,
- * but not delete the submenu.
- *
- * param hmnu The handle to the menu.
- * param item The position of the menu item or submenu.
- * param flag Indicates the position base, can be one of the following values:
- * - MF_BYCOMMANDn
- * The position value a item is based on the command identifier.
- * The new menu item will insert bellow the item whose id is a item.
- * - MF_BYPOSITIONn
- * The position value a item is based on the position in the menu.
- * return The function returns 0 for success, non-zero for failure.
- *
- * retval ERR_INVALID_HANDLE a hmnu is not a handle to menu.
- * retval ERR_INVALID_HMENU a hmnu is an invalid menu.
- *
- * sa InsertMenuItem, DeleteMenu
- */
- int GUIAPI RemoveMenu (HMENU hmnu, int item, UINT flag);
- /**
- * fn int GUIAPI DeleteMenu (HMENU hmnu, int item, UINT flag)
- * brief Deletes an item from the specified menu.
- *
- * This function deletes an item from the specified menu a hmnu.
- * Either the item is a normal menu item or a submenu, this function
- * will delete the item.
- *
- * param hmnu The handle to the menu.
- * param item The position of the menu item or submenu.
- * param flag Indicates the position base, can be one of the following values:
- * - MF_BYCOMMANDn
- * The position value a item is based on the command identifier.
- * The new menu item will insert bellow the item whose id is a item.
- * - MF_BYPOSITIONn
- * The position value a item is based on the position in the menu.
- * return The function returns 0 for success, non-zero for failure.
- *
- * retval ERR_INVALID_HANDLE a hmnu is not a handle to menu.
- * retval ERR_INVALID_HMENU a hmnu is an invalid menu.
- *
- * sa InsertMenuItem, RemoveMenu
- */
- int GUIAPI DeleteMenu (HMENU hmnu, int item, UINT flag);
- /**
- * fn int GUIAPI DestroyMenu (HMENU hmnu)
- * brief Destroys the specified menu and frees any memory that the menu occupies.
- *
- * This function destroys the specified menu a hmnu and frees any memory
- * that the menu occupies.
- *
- * param hmnu The handle to the menu.
- * return The function returns 0 for success, non-zero for failure.
- *
- * retval ERR_INVALID_HANDLE a hmnu is not a handle to menu.
- *
- * sa RemoveMenu, DeleteMenu
- */
- int GUIAPI DestroyMenu (HMENU hmnu);
- /**
- * fn int GUIAPI IsMenu (HMENU hmnu)
- * brief Determines whether a handle is a menu handle.
- *
- * This function determines whether the handle specified by a hmnu is a menu handle.
- *
- * param hmnu The handle to a menu.
- * return The function returns 0 for none menu handle, otherwise the type of the menu.
- *
- * sa CreateMenu
- */
- int GUIAPI IsMenu (HMENU hmnu);
- /**
- * fn HMENU GUIAPI SetMenu (HWND hwnd, HMENU hmnu)
- * brief Assigns a new menu to the specified main window.
- *
- * This functionn assigns the specified menu a hmnu to
- * the main window specified by a hwnd.
- *
- * param hwnd The handle to the main window.
- * param hmnu The handle to the new menu.
- *
- * return The handle to the old menu of the window.
- *
- * sa GetMenu
- */
- HMENU GUIAPI SetMenu (HWND hwnd, HMENU hmnu);
- /**
- * fn HMENU GUIAPI GetMenu (HWND hwnd)
- * brief Retrieves the handle to the menu assigned to the given main window.
- *
- * This function retrives the handle to the menu assigned to
- * the given main window a hwnd.
- *
- * param hwnd The handle to the main window.
- * return The handle to the menu of the window.
- *
- * sa SetMenu
- */
- HMENU GUIAPI GetMenu (HWND hwnd);
- /**
- * fn void GUIAPI DrawMenuBar (HWND hwnd)
- * brief Redraws the menu bar of the specified main window.
- *
- * This function redraws the menu bar of the specified main window.
- * If the menu bar changes after the system has created the window,
- * this function must be called to draw the changed menu bar.
- *
- * param hwnd The handle to the main window.
- *
- * sa TrackMenuBar
- */
- void GUIAPI DrawMenuBar (HWND hwnd);
- /**
- * fn int GUIAPI TrackMenuBar (HWND hwnd, int pos)
- * brief Displays the specified submenu.
- *
- * This function displays the specified submenu in the menu bar of
- * the specified main window a hwnd.
- *
- * param hwnd The handle to the main window.
- * param pos The position of the submenu. The position value of the
- * first submenu is 0.
- * return The function returns 0 for success, non-zero for failure.
- *
- * sa TrackPopupMenu, CreateMenu
- */
- int GUIAPI TrackMenuBar (HWND hwnd, int pos);
- /**
- * fn int GUIAPI TrackPopupMenu (HMENU hmnu, UINT uFlags, int x, int y, HWND hwnd)
- * brief Displays and tracks a popup menu.
- *
- * This function displays a shortcut menu at the specified location
- * and tracks the selection of items on the menu. The shortcut menu
- * can appear anywhere on the screen.
- *
- * param hmnu The handle to the popup menu.
- * param uFlags The tracking flags, can be OR'ed value of the following values:
- * - TPM_LEFTALIGNn
- * Horz alignement is left.
- * - TPM_CENTERALIGNn
- * Horz alignement is center.
- * - TPM_RIGHTALIGNn
- * Horz alignement is right.
- * - TPM_TOPALIGNn
- * Vert alignement is top.
- * - TPM_VCENTERALIGNn
- * Vert alignement is center.
- * - TPM_BOTTOMALIGNn
- * Vert alignement is bottom.
- * - TPM_DESTROYn
- * Destroies the popup menu after finishing tracking.
- * - TPM_SYSCMDn
- * Sends an MSG_SYSCOMMAND message to the window when the use select a menu item.
- * param x The x coordinate of the position of the popup menu.
- * param y The y coordinate of the position of the popup menu.
- * param hwnd The handle to the window which will receive
- * the MSG_COMMAND or MSG_SYSCOMMAND message.
- * return The function returns 0 for success, non-zero for failure.
- *
- * sa TrackMenuBar, CreatePopupMenu
- */
- int GUIAPI TrackPopupMenu (HMENU hmnu, UINT uFlags, int x, int y, HWND hwnd);
- /**
- * fn HMENU GUIAPI GetMenuBarItemRect (HWND hwnd, int pos, RECT* prc)
- * brief Retrieves the rect of a menu bar item.
- *
- * This function retrieves the rect of the menu bar item specified
- * by the parameter a pos.
- *
- * param hwnd The handle to the main window.
- * param pos The position of the item. The position value of the
- * first item is 0.
- * param prc The pointer to a RECT object, which will receive the rectangle.
- * return The function returns the handle to the menu bar if success,
- * otherwise returns 0.
- *
- * sa TrackMenuBar
- */
- HMENU GUIAPI GetMenuBarItemRect (HWND hwnd, int pos, RECT* prc);
- #define HMF_UPITEM 0x01
- #define HMF_DOWNITEM 0x02
- #define HMF_DEFAULT 0x00
- /**
- * fn BOOL GUIAPI HiliteMenuBarItem (HWND hwnd, int pos, UINT flag)
- * brief Draws the specified menubar item with 3D effect.
- *
- * This function draws the specified menubar item with 3D effect.
- *
- * param hwnd The handle to the main window.
- * param pos The position of the item. The position value of the
- * first item is 0.
- * param flag The drawing flag, can be one of the following values:
- * - HMF_UPITEMn
- * Up item.
- * - HMF_DOWNITEMn
- * Down item.
- * - HMF_DEFAULTn
- * Default.
- * return TRUE on success, otherwise FALSE.
- *
- * sa TrackMenuBar
- */
- BOOL GUIAPI HiliteMenuBarItem (HWND hwnd, int pos, UINT flag);
- /**
- * fn int GUIAPI GetMenuItemCount (HMENU hmnu)
- * brief Determines the number of items in a menu.
- *
- * This function determines the number of items in the specified menu a hmnu.
- *
- * param hmnu The handle to the menu.
- * return The number of the items in the menu.
- *
- * sa GetMenuItemInfo
- */
- int GUIAPI GetMenuItemCount (HMENU hmnu);
- /**
- * fnint GUIAPI GetMenuItemID (HMENU hmnu, int pos)
- * brief Retrieves the menu item identifier of a menu item at specified position in a menu.
- *
- * This function retrieves the menu item identifier of a menu item at
- * the specified position a pos in the specified menu a hmnu.
- *
- * param hmnu The handle to the menu.
- * param pos The position of the menu item. The position value of the
- * first item is 0.
- * return The identifier of the items in the menu.
- *
- * sa GetMenuItemInfo
- */
- int GUIAPI GetMenuItemID (HMENU hmnu, int pos);
- /**
- * fn int GUIAPI GetMenuItemInfo (HMENU hmnu, int item, BOOL flag, PMENUITEMINFO pmii)
- * brief Retrieves information about a menu item.
- *
- * This function retrieves information about a menu item, and returns the
- * information via a pmii.
- *
- * param hmnu The handle to the menu.
- * param item The position of the menu item or submenu.
- * param flag Indicates the position base, can be one of the following values:
- * - MF_BYCOMMANDn
- * The position value a item is based on the command identifier.
- * The new menu item will insert bellow the item whose id is a item.
- * - MF_BYPOSITIONn
- * The position value a item is based on the position in the menu.
- * param pmii The pointer to a MENUITEMINFO structure.
- * return The function returns 0 for success, non-zero for failure.
- *
- * sa SetMenuItemInfo, MENUITEMINFO
- */
- int GUIAPI GetMenuItemInfo (HMENU hmnu, int item,
- BOOL flag, PMENUITEMINFO pmii);
- int GUIAPI GetMenuItemRect (HWND hwnd, HMENU hmnu, int item, PRECT prc);
- /**
- * fn HMENU GUIAPI GetPopupSubMenu (HMENU hpppmnu)
- * brief Retrieves the submenu of the specified popup menu.
- *
- * This function retrieves the submenu of the specified popup menu.
- *
- * param hpppmnu The handle to the popup menu.
- * return The handle to the submenu of the popup menu.
- *
- * sa CreatePopupMenu
- */
- HMENU GUIAPI GetPopupSubMenu (HMENU hpppmnu);
- /**
- * fn HMENU GUIAPI StripPopupHead (HMENU hpppmnu)
- * brief Strips the head of the popup menu.
- *
- * This function strips the head of the popup menu.
- *
- * param hpppmnu The handle to the popup menu.
- * return The handle to the submenu the head stripped.
- *
- * sa GetPopupSubMenu
- */
- HMENU GUIAPI StripPopupHead (HMENU hpppmnu);
- /**
- * fn HMENU GUIAPI GetSubMenu (HMENU hmnu, int pos)
- * brief Retrieves the handle to the submenu activated by the specified menu item.
- *
- * This function retrieves the handle to the drop-down menu or submenu activated
- * by the specified menu item.
- *
- * param hmnu The handle to the menu.
- * param pos The position of the menu item. The position value of the
- * first item is 0.
- * return The handle to the submenu; 0 if the menu item can not activate a submenu.
- *
- * sa GetPopupSubMenu
- */
- HMENU GUIAPI GetSubMenu (HMENU hmnu, int pos);
- /**
- * fn HMENU GUIAPI GetSystemMenu (HWND hwnd, BOOL flag)
- * brief Allows the application to access the window menu (also known as
- * the system menu) for copying and modifying.
- *
- * This function returns the handle to the system menu of the main window.
- * This allows the application to access the window menu (also known as
- * the system menu) for copying and modifying.
- *
- * param hwnd The handle to the main window.
- * param flag Ignored.
- * return The handle to the system menu; 0 if the main window has not a system menu.
- *
- * sa GetMenu, SetMenu
- */
- HMENU GUIAPI GetSystemMenu (HWND hwnd, BOOL flag);
- /**
- * fn UINT GUIAPI EnableMenuItem (HMENU hmnu, int item, UINT flag)
- * brief Enables, disables, or grays the specified menu item.
- *
- * This function enables, disables, or grays the specified menu item.
- *
- * param hmnu The handle to the menu.
- * param item The position of the menu item or submenu.
- * param flag Indicates the position base, can be one of the following values:
- * - MF_BYCOMMANDn
- * The position value a item is based on the command identifier.
- * The new menu item will insert bellow the item whose id is a item.
- * - MF_BYPOSITIONn
- * The position value a item is based on the position in the menu.
- * return The previous state of the menu item.
- *
- * sa GetMenuItemInfo
- */
- UINT GUIAPI EnableMenuItem (HMENU hmnu, int item, UINT flag);
- /**
- * fn int GUIAPI CheckMenuRadioItem (HMENU hmnu, int first, int last, int checkitem, UINT flag)
- * brief Checks a specified menu item and makes it a radio item.
- *
- * This function checks a specified menu item and makes it a radio item.
- * At the same time, the function unchecks all other menu items in the
- * associated group and clears the radio-item type flag for those items.
- *
- * param hmnu The handle to the menu.
- * param first The position of the first item in the group.
- * param last The position of the last item in the group.
- * param checkitem The position of the menu item to check.
- * param flag Indicates the position base, can be one of the following values:
- * - MF_BYCOMMANDn
- * The position value a item is based on the command identifier.
- * The new menu item will insert bellow the item whose id is a item.
- * - MF_BYPOSITIONn
- * The position value a item is based on the position in the menu.
- * return The function returns 0 for success, non-zero for failure.
- *
- * sa SetMenuItemInfo, MENUITEMINFO
- */
- int GUIAPI CheckMenuRadioItem (HMENU hmnu, int first, int last,
- int checkitem, UINT flag);
- /**
- * fn int GUIAPI SetMenuItemBitmaps (HMENU hmnu, int item, UINT flag, PBITMAP hBmpUnchecked, PBITMAP hBmpChecked)
- * brief Associates the specified bitmap with a menu item.
- *
- * This function associates the specified bitmap with a menu item.
- * Whether the menu item is checked or unchecked, the system displays the
- * appropriate bitmap next to the menu item.
- *
- * param hmnu The handle to the menu.
- * param item The position of the menu item.
- * param flag Indicates the position base, can be one of the following values:
- * - MF_BYCOMMANDn
- * The position value a item is based on the command identifier.
- * The new menu item will insert bellow the item whose id is a item.
- * - MF_BYPOSITIONn
- * The position value a item is based on the position in the menu.
- * param hBmpUnchecked The pointer to the unchecked BITMAP object.
- * param hBmpChecked The pointer to the checked BITMAP object.
- * return The function returns 0 for success, non-zero for failure.
- *
- * sa SetMenuItemInfo, MENUITEMINFO
- */
- int GUIAPI SetMenuItemBitmaps (HMENU hmnu, int item, UINT flag,
- PBITMAP hBmpUnchecked, PBITMAP hBmpChecked);
- /**
- * fn int GUIAPI SetMenuItemInfo (HMENU hmnu, int item, BOOL flag, PMENUITEMINFO pmii)
- * brief Changes information about a menu item.
- *
- * This function changes information about the specified menu item.
- *
- * param hmnu The handle to the menu.
- * param item The position of the menu item.
- * param flag Indicates the position base, can be one of the following values:
- * - MF_BYCOMMANDn
- * The position value a item is based on the command identifier.
- * The new menu item will insert bellow the item whose id is a item.
- * - MF_BYPOSITIONn
- * The position value a item is based on the position in the menu.
- * param pmii The pointer to a MENUITEMINFO structure contains the information.
- * return The function returns 0 for success, non-zero for failure.
- *
- * sa GetMenuItemInfo, MENUITEMINFO
- */
- int GUIAPI SetMenuItemInfo (HMENU hmnu, int item,
- BOOL flag, PMENUITEMINFO pmii);
- /** @} end of menu_fns */
- /**
- * defgroup dialog_fns Dialog operations
- * @{
- */
- /* Dialog codes */
- #define DLGC_WANTARROWS 0x0001 /* Control wants arrow keys */
- #define DLGC_WANTTAB 0x0002 /* Control wants tab keys */
- #define DLGC_WANTALLKEYS 0x0004 /* Control wants all keys */
- #define DLGC_WANTCHARS 0x0008 /* Want MSG_CHAR messages */
- #define DLGC_WANTENTER 0x0010 /* Control wants enter keys */
- #define DLGC_HASSETSEL 0x0080 /* Understands EM_SETSEL message */
- #define DLGC_DEFPUSHBUTTON 0x0100 /* Default pushbutton */
- #define DLGC_PUSHBUTTON 0x0200 /* Non-default pushbutton */
- #define DLGC_RADIOBUTTON 0x0400 /* Radio button */
- #define DLGC_3STATE 0x0800 /* 3 States button item */
- #define DLGC_STATIC 0x1000 /* Static item: don't include */
- #define DLGC_BUTTON 0x2000 /* Button item: can be checked */
- /**
- * Structure which defines a control.
- */
- typedef struct _CTRLDATA
- {
- char* class_name; /** class name of the control */
- DWORD dwStyle; /** control style */
- int x, y, w, h; /** control position in dialog */
- int id; /** control identifier */
- const char* caption; /** control caption */
- DWORD dwAddData; /** additional data */
- DWORD dwExStyle; /** control extended style */
- } CTRLDATA;
- typedef CTRLDATA* PCTRLDATA;
- /**
- * Structure which defines a dialogbox.
- *
- * Example:
- *
- * include dlgtemplate.c
- */
- typedef struct _DLGTEMPLATE
- {
- DWORD dwStyle; /** dialog box style */
- DWORD dwExStyle; /** dialog box extended style */
- int x, y, w, h; /** dialog box position */
- const char* caption; /** dialog box caption */
- HICON hIcon; /** dialog box icon */
- HMENU hMenu; /** dialog box menu */
- int controlnr; /** number of controls */
- PCTRLDATA controls; /** poiter to control array */
- DWORD dwAddData; /** addtional data, must be zero */
- } DLGTEMPLATE;
- typedef DLGTEMPLATE* PDLGTEMPLATE;
- /**
- * fn HWND GUIAPI CreateMainWindowIndirectParam (PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc, LPARAM lParam)
- * brief Uses a dialog template to create a main window and controls in it, and pass a parameter to the window procedure.
- *
- * This function uses a dialog template pointed to by a pDlgTemplate
- * to create a main window and controls in it. The parameter specified by
- * a lParam will be passed to the window procedure as the second paramter
- * of MSG_INITDIALOG message.
- *
- * param pDlgTemplate The pointer to a DLGTEMPLATE structure.
- * param hOwner The handle to the hosting main window.
- * param WndProc The window procedure of the new main window.
- * param lParam The parameter will be passed to the window procedure.
- * return Handle to the new main window, HWND_INVALID on error.
- *
- * sa DestroyMainWindowIndirect, DialogBoxIndirectParam, DLGTEMPLATE
- */
- HWND GUIAPI CreateMainWindowIndirectParam (PDLGTEMPLATE pDlgTemplate,
- HWND hOwner, WNDPROC WndProc, LPARAM lParam);
- /**
- * def CreateMainWindowIndirect(pDlgTemplate, hOwner, WndProc)
- * brief An simplified version of a CreateMainWindowIndirectParam.
- *
- * This macro calls a CreateMainWindowIndirectParam with a lParam set to be 0.
- */
- #define CreateMainWindowIndirect(pDlgTemplate, hOwner, WndProc)
- CreateMainWindowIndirectParam(pDlgTemplate, hOwner, WndProc, 0)
- /**
- * fn BOOL GUIAPI DestroyMainWindowIndirect (HWND hMainWin)
- * brief Destroys a main window created by a CreateMainWindowIndirectParam.
- *
- * This function destroys the main window which was created by
- * a CreateMainWindowIndirectParam function.
- *
- * param hMainWin The handle to the main window.
- *
- * sa CreateMainWindowIndirectParam
- */
- BOOL GUIAPI DestroyMainWindowIndirect (HWND hMainWin);
- /**
- * fn int GUIAPI DialogBoxIndirectParam (PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC DlgProc, LPARAM lParam)
- * brief 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 dialog box controls.
- *
- * param pDlgTemplate The pointer to a DLGTEMPLATE structure.
- * param hOwner The handle to the hosting main window.
- * param DlgProc The window procedure of the new dialog box.
- * param lParam The parameter will be passed to the window procedure.
- * return Handle to the new main window, HWND_INVALID on error.
- *
- * sa CreateMainWindowIndirectParam, DLGTEMPLATE
- *
- * Example:
- *
- * include dialogbox.c
- */
- int GUIAPI DialogBoxIndirectParam (PDLGTEMPLATE pDlgTemplate,
- HWND hOwner, WNDPROC DlgProc, LPARAM lParam);
- /**
- * fn BOOL GUIAPI EndDialog (HWND hDlg, int endCode)
- * brief Destroys a modal dialog box, causing MiniGUI to end any processing for the dialog box.
- *
- * This function destroys the modal dialog box a hDlg created by a DialogBoxIndirectParam
- * and ends any processing for the dialog box. The argument a endCode will be returned
- * by a DialogBoxIndirectParam as the return value.
- *
- * param hDlg The handle to the dialog box.
- * param endCode The value will be returned by a DialogBoxIndirectParam.
- *
- * return TRUE on success, FALSE on error.
- */
- BOOL GUIAPI EndDialog (HWND hDlg, int endCode);
- /**
- * fn void GUIAPI DestroyAllControls (HWND hWnd)
- * brief Destroys all controls in a window.
- *
- * This function destroys all controls (child windows) in a window.
- *
- * param hWnd The handle to the window.
- *
- * sa DestroyWindow
- */
- void GUIAPI DestroyAllControls (HWND hWnd);
- /**
- * fn int GUIAPI DefaultDialogProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
- * brief The default dialog box procedure.
- *
- * This function is the default dialog box procedure.
- * You should call this function in your dialog box procedure
- * to process the unhandled messages.
- *
- * param hWnd The handle to the window.
- * param message The message identifier.
- * param wParam The first message parameter.
- * param lParam The second message parameter.
- * return The return value of the message handler.
- */
- int GUIAPI DefaultDialogProc (HWND hWnd,
- int message, WPARAM wParam, LPARAM lParam);
- /**
- * fn HWND GUIAPI GetDlgDefPushButton (HWND hWnd)
- * brief 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 a hWnd.
- *
- * param hWnd The handle to the window.
- * return The handle to the default push button,
- * zero for non default push button in the window.
- */
- HWND GUIAPI GetDlgDefPushButton (HWND hWnd);
- /**
- * fn int GUIAPI GetDlgCtrlID (HWND hwndCtl)
- * brief Gets the integer identifier of a control.
- *
- * This function gets the integer identifier of the control a hwndCtl.
- *
- * param hwndCtl The handle to the control.
- * return The identifier of the control, -1 for error.
- *
- * sa GetDlgItem
- */
- int GUIAPI GetDlgCtrlID (HWND hwndCtl);
- /**
- * fn HWND GUIAPI GetDlgItem (HWND hDlg, int nIDDlgItem)
- * brief Retrives the handle to a control in a dialog box.
- *
- * This function retrives the handle to a control, whose identifier is a nIDDlgItem,
- * in the specified dialog box a hDlg.
- *
- * param hDlg The handle to the dialog box.
- * param nIDDlgItem The identifier of the control.
- * return The handle to the control, zero for not found.
- */
- HWND GUIAPI GetDlgItem (HWND hDlg, int nIDDlgItem);
- /**
- * fn UINT GUIAPI GetDlgItemInt (HWND hDlg, int nIDDlgItem, BOOL *lpTranslated, BOOL bSigned)
- * brief 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 a nIDDlgItem
- * in the dialog box a hDlg into an integer value.
- *
- * param hDlg The handle to the dialog box.
- * param nIDDlgItem The identifier of the control.
- * param lpTranslated The pointer to a boolean value, which indicates whether
- * translated successfully.
- * param bSigned Indicates whether handle the text as a signed integer.
- * return The translated 32-bit integer.
- *
- * note MiniGUI uses a strtol or a 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]*n
- * Will be read in base 16.
- * - [+|-]0[0-7]*n
- * Will be read in base 8.
- * - [+|-][1-9][0-9]*n
- * Will be read in base 10.
- *
- * sa GetDlgItemText, SetDlgItemInt
- */
- UINT GUIAPI GetDlgItemInt (HWND hDlg, int nIDDlgItem, BOOL *lpTranslated,
- BOOL bSigned);
- /**
- * fn int GUIAPI GetDlgItemText (HWND hDlg, int nIDDlgItem, char* lpString, int nMaxCount)
- * brief 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 a nIDDlgItem in the dialog box a hDlg.
- *
- * param hDlg The handle to the dialog box.
- * param nIDDlgItem The identifier of the control.
- * param lpString The pointer to a buffer which receives the text.
- * param nMaxCount The maximal length of the string, not including the null character.
- * return The length of the null-terminated text.
- *
- * note The buffer should at least have size of (a nMaxCount + 1).
- *
- * sa GetDlgItemInt, GetDlgItemText2
- */
- int GUIAPI GetDlgItemText (HWND hDlg, int nIDDlgItem, char* lpString,
- int nMaxCount);
- /**
- * fn char* GUIAPI GetDlgItemText2 (HWND hDlg, int id, int* lenPtr)
- * brief Retrieves the title or text associated with a control in a dialog box.
- *
- * This function is similiar as a 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
- * a free function.
- *
- * param hDlg The handle to the dialog box.
- * param id The identifier of the control.
- * param lenPtr The pointer to an integer which receives the length of the text
- * if it is not NULL.
- * return The pointer to the allocated buffer.
- *
- * sa GetDlgItemText
- */
- char* GUIAPI GetDlgItemText2 (HWND hDlg, int id, int* lenPtr);
- /**
- * fn HWND GUIAPI GetNextDlgGroupItem (HWND hDlg, HWND hCtl, BOOL bPrevious)
- * brief 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 a hCtl
- * in the dialog box a hDlg.
- *
- * param hDlg The handle to the dialog box.
- * param hCtl The handle to the control.
- * param bPrevious A boolean value indicates to retrive the preceding or following control.
- * TRUE for preceding control.
- * return The handle to the preceding or following control.
- *
- * sa GetNextDlgTabItem
- */
- HWND GUIAPI GetNextDlgGroupItem (HWND hDlg, HWND hCtl, BOOL bPrevious);
- /**
- * fn HWND GUIAPI GetNextDlgTabItem (HWND hDlg, HWND hCtl, BOOL bPrevious)
- * brief 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 a hCtl
- * in the dialog box a hDlg.
- *
- * param hDlg The handle to the dialog box.
- * param hCtl The handle to the control.
- * param bPrevious A boolean value indicates to retrive the preceding or following control.
- * TRUE for preceding control.
- * return The handle to the preceding or following control.
- *
- * sa GetNextDlgGroupItem
- */
- HWND GUIAPI GetNextDlgTabItem (HWND hDlg, HWND hCtl, BOOL bPrevious);
- /**
- * fn int GUIAPI SendDlgItemMessage (HWND hDlg, int nIDDlgItem, int message, WPARAM wParam, LPARAM lParam)
- * brief Sends a message to the specified control in a dialog box.
- *
- * This function sends a message specified by (a message, a wParam, a lParam)
- * to the specified control whose identifier is a nIDDlgItem in the dialog box a hDlg.
- *
- * param hDlg The handle to the dialog box.
- * param nIDDlgItem The identifier of the control.
- * param message The message identifier.
- * param wParam The first message parameter.
- * param lParam The second message parameter.
- * return The return value of the message handler.
- *
- * sa SendMessage, GetDlgItem
- */
- int GUIAPI SendDlgItemMessage ( HWND hDlg, int nIDDlgItem,
- int message, WPARAM wParam, LPARAM lParam);
- /**
- * fn BOOL GUIAPI SetDlgItemInt (HWND hDlg, int nIDDlgItem, UINT uValue, BOOL bSigned)
- * brief 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 a nIDDlgItem
- * in the dialog box a hDlg to the string representation of
- * the specified integer value a nValue.
- *
- * param hDlg The handle to the dialog box.
- * param nIDDlgItem The identifier of the control.
- * param uValue The 32-bit integer value.
- * param bSigned A boolean value indicates whether the integer value is a signed integer.
- * return TRUE on success, FALSE on error.
- *
- * sa GetDlgItemInt, SetDlgItemText
- */
- BOOL GUIAPI SetDlgItemInt (HWND hDlg, int nIDDlgItem, UINT uValue,
- BOOL bSigned);
- /**
- * fn BOOL GUIAPI SetDlgItemText (HWND hDlg, int nIDDlgItem, const char* lpString)
- * brief 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 a nIDDlgItem
- * in the dialog box a hDlg to the string pointed to by a lpString.
- *
- * param hDlg The handle to the dialog box.
- * param nIDDlgItem The identifier of the control.
- * param lpString The pointer to the string.
- * return TRUE on success, FALSE on error.
- *
- * sa GetDlgItemText, SetDlgItemInt
- */
- BOOL GUIAPI SetDlgItemText (HWND hDlg, int nIDDlgItem, const char* lpString);
- #ifdef _CTRL_BUTTON
- /**
- * fn void GUIAPI CheckDlgButton (HWND hDlg, int nIDDlgItem, int nCheck)
- * brief Changes the check status of a button control.
- *
- * This function changes the check status of the button control whose
- * identifier is a nIDDlgItem in the dialog box a hDlg.
- *
- * param hDlg The handle to the dialog box.
- * param nIDDlgItem The identifier of the control.
- * param 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_UNCHECKEDn
- * The button is unchecked.
- * - BST_CHECKEDn
- * The button is checked.
- * - BST_INDETERMINATEn
- * The button is in indeterminate state.
- *
- * sa CheckRadioButton, IsDlgButtonChecked
- */
- void GUIAPI CheckDlgButton (HWND hDlg, int nIDDlgItem, int nCheck);
- /**
- * fn void GUIAPI CheckRadioButton (HWND hDlg, int idFirstButton, int idLastButton, int idCheckButton)
- * brief 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 a idCheckButton
- * in a group between a idFirstButton and a idLastButton, and removes
- * a check mark from (clears) all other radio buttons in the group.
- *
- * param hDlg The handle to the dialog box.
- * param idFirstButton The identifier of the first control in the group.
- * param idLastButton The identifier of the last control in the group.
- * param idCheckButton The identifier of the control to be checked.
- *
- * sa CheckDlgButton
- */
- void GUIAPI CheckRadioButton (HWND hDlg,
- int idFirstButton, int idLastButton, int idCheckButton);
- /**
- * fn int GUIAPI IsDlgButtonChecked (HWND hDlg, int idButton)
- * brief 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 a idButton
- * has a check mark next to it or whether a three-state button control is grayed,
- * checked, or neither.
- *
- * param hDlg The handle to the dialog box.
- * param idButton The identifier of the button.
- * return 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_UNCHECKEDn
- * The button is unchecked.
- * - BST_CHECKEDn
- * The button is checked.
- * - BST_INDETERMINATEn
- * The button is in indeterminate state.
- *
- * sa CheckDlgButton
- */
- int GUIAPI IsDlgButtonChecked (HWND hDlg, int idButton);
- #endif
- /** @} end of dialog_fns */
- /**
- * defgroup msgbox_fns Message box operations
- * @{
- */
- #if defined(_CTRL_STATIC) && defined (_CTRL_BUTTON)
- /* Standard control IDs */
- #define IDC_STATIC 0
- #define IDOK 1
- #define IDCANCEL 2
- #define IDABORT 3
- #define IDRETRY 4
- #define IDIGNORE 5
- #define IDYES 6
- #define IDNO 7
- #define MINID_RESERVED 0xF001
- #define MAXID_RESERVED 0xFFFF
- #define MB_OK 0x00000000
- #define MB_OKCANCEL 0x00000001
- #define MB_YESNO 0x00000002
- #define MB_RETRYCANCEL 0x00000003
- #define MB_ABORTRETRYIGNORE 0x00000004
- #define MB_YESNOCANCEL 0x00000005
- #define MB_CANCELASBACK 0x00000008 /* customized style */
- #define MB_TYPEMASK 0x00000007
- #define MB_ICONHAND 0x00000010
- #define MB_ICONQUESTION 0x00000020
- #define MB_ICONEXCLAMATION 0x00000030
- #define MB_ICONASTERISK 0x00000040
- #define MB_ICONMASK 0x000000F0
- #define MB_ICONINFORMATION MB_ICONASTERISK
- #define MB_ICONSTOP MB_ICONHAND
- #define MB_DEFBUTTON1 0x00000000
- #define MB_DEFBUTTON2 0x00000100
- #define MB_DEFBUTTON3 0x00000200
- #define MB_DEFMASK 0x00000F00
- /* #define MB_APPLMODAL 0x00000000 */
- /* #define MB_SYSTEMMODAL 0x00001000 */
- /* #define MB_TASKMODAL 0x00002000 */
- #define MB_NOFOCUS 0x00008000
- #define MB_ALIGNCENTER 0x00000000
- #define MB_ALIGNTOPLEFT 0x00010000
- #define MB_ALIGNBTMLEFT 0x00020000
- #define MB_ALIGNTOPRIGHT 0x00030000
- #define MB_ALIGNBTMRIGHT 0x00040000
- #define MB_ALIGNMASK 0x00070000
- #define MB_BASEDONPARENT 0x00080000 /* default is desktop. */
- /**
- * fn int GUIAPI MessageBox (HWND hParentWnd, const char* pszText, const char* pszCaption, DWORD dwStyle)
- * brief Displays a message box within one, two, or three push buttons.
- *
- * This function displays a message box within one, two, or three buttons, and returns
- * the identifier of the button clicked by the user. You can pass a dwStyle argument
- * with different values to control the number of buttons, the button titles, and so on.
- *
- * param hParentWnd The handle to the hosting main window.
- * param pszText The message text will be displayed in the message box.
- * param pszCaption The caption of the message box.
- * param dwStyle The style of the message box, can be one or'ed value of the following styles:
- * - MB_OKn
- * Create a message box within only one button whose title is "OK".
- * - MB_OKCANCELn
- * Create a message box within two buttons whose title are "OK" and "Cancel" respectively.
- * - MB_YESNOn
- * Create a message box within two buttons whose title are "Yes" and "No" respectively.
- * - MB_RETRYCANCELn
- * Create a message box within two buttons whose title are "Retry" and "Cancel" respectively.
- * - MB_ABORTRETRYIGNOREn
- * Create a message box within three buttons whose title are "Abort", "Retry" and "Ignore" respectively.
- * - MB_YESNOCANCELn
- * Create a message box within three buttons whose title are "Yes", "No" and "Cancel" respectively.
- * - MB_CANCELASBACKn
- * Title "Cancel" replaced with title "Previous".
- * - MB_ICONHANDn
- * Display a hand/stop icon in the message box.
- * - MB_ICONQUESTIONn
- * Display a question mark icon in the message box.
- * - MB_ICONEXCLAMATIONn
- * Display a exclamation mark icon in the message box.
- * - MB_ICONASTERISKn
- * Display an information icon in the message box.
- * - MB_ICONINFORMATIONn
- * Display an information icon in the message box.
- * - MB_ICONSTOPn
- * Display a hand/stop icon in the message box.
- * - MB_DEFBUTTON1n
- * The first push button acts as the default button.
- * - MB_DEFBUTTON2n
- * The second push button acts as the default button.
- * - MB_DEFBUTTON3n
- * The third push button acts as the default button.
- * - MB_ALIGNCENTERn
- * The message box is center aligned.
- * - MB_ALIGNTOPLEFTn
- * The message box is upper-left aligned.
- * - MB_ALIGNBTMLEFTn
- * The message box is lower-left aligned.
- * - MB_ALIGNTOPRIGHTn
- * The message box is upper-right aligned.
- * - MB_ALIGNBTMRIGHTn
- * The message box is lower-right aligned.
- * - MB_BASEDONPARENTn
- * A flag indicates that the alignments above are based on the hosting window, not the desktop.
- *
- * return The identifier of the button clicked by user, can be one of the following values:
- * - IDOKn
- * The "OK" button clicked.
- * - IDCANCELn
- * The "Cancel" or "Previous" button clicked.
- * - IDABORTn
- * The "Abort" button clicked.
- * - IDRETRYn
- * The "Retry" button clicked.
- * - IDIGNOREn
- * The "Ignore" button clicked.
- * - IDYESn
- * The "Yes" button clicked.
- * - IDNOn
- * The "No" button clicked.
- *
- * note This function will call a GetSysText to translate the button titles to localized text.
- *
- * sa GetSysText, DialogBoxIndirectParam
- */
- int GUIAPI MessageBox (HWND hParentWnd, const char* pszText,
- const char* pszCaption, DWORD dwStyle);
- #endif /* _CTRL_STATIC && _CTRL_BUTTON */
- /**
- * fn void GUIAPI MessageBeep (DWORD dwBeep)
- * brief Makes a sound of beep.
- *
- * This function makes a sound of beep. We ignore a dwBeep argument so far.
- *
- * param dwBeep The beep type, ignored so far.
- *
- * sa Beep, Ping, Tone
- */
- void GUIAPI MessageBeep (DWORD dwBeep);
- /** @} end of dialog_fns */
- /** @} end of window_fns */
- /** @} end of fns */
- #ifdef __cplusplus
- }
- #endif /* __cplusplus */
- #endif /* _MGUI_WINDOW_H */