MiniGUI API Reference (MiniGUI-Standalone)
v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
Macros | |
#define | SetFocus SetFocusChild |
#define | GetFocus GetFocusChild |
#define | GetForegroundWindow GetActiveWindow |
#define | SetForegroundWindow SetActiveWindow |
#define | GetWindowElementColor(iItem) GetWindowElementPixelEx(HWND_NULL, (HDC)-1, iItem) |
Get window element color. More... | |
Functions | |
MG_EXPORT void GUIAPI | UpdateWindow (HWND hWnd, BOOL bErase) |
Updates a window. More... | |
MG_EXPORT BOOL GUIAPI | ShowWindow (HWND hWnd, int iCmdShow) |
Shows or hides a window. More... | |
MG_EXPORT BOOL GUIAPI | EnableWindow (HWND hWnd, BOOL fEnable) |
Enables of disables a window. More... | |
MG_EXPORT BOOL GUIAPI | IsWindowEnabled (HWND hWnd) |
Determines whether the specified window is enabled for mouse and keyboard input. More... | |
MG_EXPORT BOOL GUIAPI | GetClientRect (HWND hWnd, PRECT prc) |
Retrives the client rectangle of a window. More... | |
MG_EXPORT gal_pixel GUIAPI | GetWindowBkColor (HWND hWnd) |
Returns the current background color of a window. More... | |
MG_EXPORT gal_pixel GUIAPI | SetWindowBkColor (HWND hWnd, gal_pixel new_bkcolor) |
Sets the background color of a window. More... | |
MG_EXPORT PLOGFONT GUIAPI | GetWindowFont (HWND hWnd) |
Retrives the default font of a window. More... | |
MG_EXPORT PLOGFONT GUIAPI | SetWindowFont (HWND hWnd, PLOGFONT pLogFont) |
Sets the default font of a window. More... | |
MG_EXPORT HCURSOR GUIAPI | GetWindowCursor (HWND hWnd) |
Retrives the current cursor of a window. More... | |
MG_EXPORT HCURSOR GUIAPI | SetWindowCursor (HWND hWnd, HCURSOR hNewCursor) |
Sets the current cursor of a window. More... | |
MG_EXPORT HICON GUIAPI | GetWindowIcon (HWND hWnd) |
Retrives the current icon of a window. More... | |
MG_EXPORT HICON GUIAPI | SetWindowIcon (HWND hWnd, HICON hIcon, BOOL bRedraw) |
Sets the current icon of a window. More... | |
MG_EXPORT DWORD GUIAPI | GetWindowStyle (HWND hWnd) |
Retrives the style of a window. More... | |
MG_EXPORT DWORD GUIAPI | GetWindowExStyle (HWND hWnd) |
Retrives the extended style of a window. More... | |
MG_EXPORT BOOL GUIAPI | ExcludeWindowStyle (HWND hWnd, DWORD dwStyle) |
Removes the specific style of a window. More... | |
MG_EXPORT BOOL GUIAPI | IncludeWindowStyle (HWND hWnd, DWORD dwStyle) |
Includes the specific style of a window. More... | |
MG_EXPORT BOOL GUIAPI | ExcludeWindowExStyle (HWND hWnd, DWORD dwStyle) |
Removes the specific extended style of a window. More... | |
MG_EXPORT BOOL GUIAPI | IncludeWindowExStyle (HWND hWnd, DWORD dwStyle) |
Includes the specific extended style of a window. More... | |
MG_EXPORT WNDPROC GUIAPI | GetWindowCallbackProc (HWND hWnd) |
Retrives the callback procedure of a window. More... | |
MG_EXPORT WNDPROC GUIAPI | SetWindowCallbackProc (HWND hWnd, WNDPROC newProc) |
Sets the callback procedure of a window. More... | |
MG_EXPORT DWORD GUIAPI | GetWindowAdditionalData (HWND hWnd) |
Retrives the first additional data of a window. More... | |
MG_EXPORT DWORD GUIAPI | SetWindowAdditionalData (HWND hWnd, DWORD newData) |
Sets the first additional data of a window. More... | |
MG_EXPORT DWORD GUIAPI | GetWindowAdditionalData2 (HWND hWnd) |
Retrives the second additional data of a window. More... | |
MG_EXPORT DWORD GUIAPI | SetWindowAdditionalData2 (HWND hWnd, DWORD newData) |
Sets the second additional data of a window. More... | |
MG_EXPORT DWORD GUIAPI | GetWindowClassAdditionalData (HWND hWnd) |
Retrives the additional data of a control class. More... | |
MG_EXPORT DWORD GUIAPI | SetWindowClassAdditionalData (HWND hWnd, DWORD newData) |
Sets the additional data of a control class. More... | |
MG_EXPORT const char *GUIAPI | GetWindowCaption (HWND hWnd) |
Retrives the caption of a window. More... | |
MG_EXPORT BOOL GUIAPI | SetWindowCaption (HWND hWnd, const char *spCaption) |
Sets the caption of a window. More... | |
MG_EXPORT BOOL GUIAPI | InvalidateRect (HWND hWnd, const RECT *prc, BOOL bEraseBkgnd) |
Makes a rectangle region in the client area of a window invalid. More... | |
MG_EXPORT BOOL GUIAPI | InvalidateRegion (HWND hWnd, const CLIPRGN *pRgn, BOOL bErase) |
Invalidates the client area within the specified region. More... | |
MG_EXPORT BOOL GUIAPI | ValidateRect (HWND hWnd, const RECT *rect) |
Validates the client area within a rectangle by removing the rectangle from the update region of the specified window. More... | |
MG_EXPORT BOOL GUIAPI | ValidateRegion (HWND hWnd, const CLIPRGN *pRgn) |
Validates the client area within a region by removing the region from the current update region of the specified window. More... | |
MG_EXPORT HDC GUIAPI | BeginPaint (HWND hWnd) |
Prepares a window for painting. More... | |
MG_EXPORT void GUIAPI | EndPaint (HWND hWnd, HDC hdc) |
Marks the end of painting in a window. More... | |
MG_EXPORT BOOL GUIAPI | GetUpdateRect (HWND hWnd, RECT *update_rect) |
Retrives the bounding box of the update region of a window. More... | |
MG_EXPORT int GUIAPI | GetUpdateRegion (HWND hWnd, PCLIPRGN pRgn) |
Copy the update region of a window to a region. More... | |
MG_EXPORT int GUIAPI | ClientWidthToWindowWidthEx (DWORD dwStyle, int win_type, int cw) |
Calculates main window width from the width of the client area. More... | |
MG_EXPORT int GUIAPI | ClientHeightToWindowHeightEx (DWORD dwStyle, int win_type, int ch, BOOL hasMenu) |
Calculates window height from the height of the client area. More... | |
MG_EXPORT BOOL GUIAPI | AdjustWindowRectEx (RECT *pRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle) |
Calculates the required size of the window rectangle based on the desired size of the client rectangle. More... | |
MG_EXPORT void GUIAPI | ClientToScreen (HWND hWnd, int *x, int *y) |
Converts the client coordinates of a point to screen coordinates. More... | |
MG_EXPORT void GUIAPI | ScreenToClient (HWND hWnd, int *x, int *y) |
Converts the screen coordinates of a point to client coordinates. More... | |
MG_EXPORT void GUIAPI | ClientToWindow (HWND hWnd, int *x, int *y) |
Converts the client coordinates to the window coordinates. More... | |
MG_EXPORT void GUIAPI | WindowToClient (HWND hWnd, int *x, int *y) |
Converts the window coordinates to client coordinates. More... | |
MG_EXPORT void GUIAPI | WindowToScreen (HWND hWnd, int *x, int *y) |
Converts the window coordinates of a point to screen coordinates. More... | |
MG_EXPORT void GUIAPI | ScreenToWindow (HWND hWnd, int *x, int *y) |
Converts the screen coordinates of a point to window coordinates. More... | |
MG_EXPORT BOOL GUIAPI | IsMainWindow (HWND hWnd) |
Determines whether a window is a main window. More... | |
MG_EXPORT BOOL GUIAPI | IsControl (HWND hWnd) |
Determines whether a window is a control. More... | |
MG_EXPORT BOOL GUIAPI | IsWindow (HWND hWnd) |
Determines whether a window handle identifies an existing window. More... | |
MG_EXPORT BOOL GUIAPI | IsDialog (HWND hWnd) |
Determines whether a window handle identifies a dialog window. More... | |
MG_EXPORT HWND GUIAPI | GetParent (HWND hWnd) |
Retrieves the handle to a child window's parent window. More... | |
MG_EXPORT HWND GUIAPI | GetMainWindowHandle (HWND hWnd) |
Retrives the handle to the main window contains a window. More... | |
MG_EXPORT BOOL GUIAPI | IsWindowVisible (HWND hWnd) |
Retrieves the visibility state of the specified window. More... | |
MG_EXPORT BOOL GUIAPI | GetWindowRect (HWND hWnd, PRECT prc) |
Retrives the dimensions of the bounding rectangle of a window. More... | |
MG_EXPORT HWND GUIAPI | GetNextChild (HWND hWnd, HWND hChild) |
Retrives the next control in a window. More... | |
MG_EXPORT HWND GUIAPI | GetNextMainWindow (HWND hMainWnd) |
Retrives the next main window in the system according to the zorder. More... | |
MG_EXPORT HWND GUIAPI | GetHosting (HWND hMainWnd) |
Retrives the hosting main window of a main window. More... | |
MG_EXPORT HWND GUIAPI | GetFirstHosted (HWND hHosting) |
Retrives the first hosted main window of a main window. More... | |
MG_EXPORT HWND GUIAPI | GetNextHosted (HWND hHosting, HWND hHosted) |
Retrives the next hosted main window of a main window. More... | |
MG_EXPORT int GUIAPI | GetWindowTextLength (HWND hWnd) |
Retrieves the length of a window's text. More... | |
MG_EXPORT int GUIAPI | GetWindowText (HWND hWnd, char *spString, int nMaxLen) |
Copies the text of a window's into a buffer. More... | |
MG_EXPORT BOOL GUIAPI | SetWindowText (HWND hWnd, const char *spString) |
Sets the text of a window. More... | |
MG_EXPORT HWND GUIAPI | GetFocusChild (HWND hParent) |
Retrieves the handle to the window's active child that has the keyboard focus. More... | |
MG_EXPORT HWND GUIAPI | SetNullFocus (HWND hParent) |
Cancels the current active child and set the focus child to be null. More... | |
MG_EXPORT HWND GUIAPI | SetFocusChild (HWND hWnd) |
Sets the active child of a window. More... | |
MG_EXPORT HWND GUIAPI | GetActiveWindow (void) |
Retrieves the main window handle to the active main window. More... | |
MG_EXPORT HWND GUIAPI | SetActiveWindow (HWND hMainWnd) |
Sets a main window to be the active main window. More... | |
MG_EXPORT HWND GUIAPI | GetCapture (void) |
Retrives the handle to the window (if any) that has captured the mouse. More... | |
MG_EXPORT HWND GUIAPI | SetCapture (HWND hWnd) |
Sets the mouse capture to the specified window. More... | |
MG_EXPORT void GUIAPI | ReleaseCapture (void) |
Releases the mouse capture from a window and restores normal mouse input processing. More... | |
MG_EXPORT HWND GUIAPI | GetWindowUnderCursor (void) |
Retrives the handle to the window (if any) which is just beneath the mouse cursor. More... | |
MG_EXPORT HWND GUIAPI | WindowFromPointEx (POINT pt, BOOL bRecursion) |
Retrieves a handle to the window that contains the specified point. More... | |
MG_EXPORT HWND GUIAPI | ChildWindowFromPointEx (HWND hParent, POINT pt, UINT uFlags) |
Retrives a handle to the child window that contains the speicified point and meets the certain criteria. More... | |
static HWND GUIAPI | ChildWindowFromPoint (HWND hParent, POINT pt) |
Retrives a handle to the child window that contains the speicified point. More... | |
MG_EXPORT BOOL GUIAPI | MoveWindow (HWND hWnd, int x, int y, int w, int h, BOOL fPaint) |
Changes the position and dimensions of a window. More... | |
MG_EXPORT int GUIAPI | ScrollWindowEx (HWND hWnd, int dx, int dy, const RECT *prcScroll, const RECT *prcClip, PCLIPRGN pRgnUpdate, PRECT prcUpdate, UINT flags) |
Scrolls the content of a window's client area. More... | |
static void GUIAPI | ScrollWindow (HWND hWnd, int dx, int dy, const RECT *prcScroll, const RECT *prcClip) |
Scrolls the content of a window's client area. More... | |
#define GetFocus GetFocusChild |
#define GetForegroundWindow GetActiveWindow |
#define GetWindowElementColor | ( | iItem | ) | GetWindowElementPixelEx(HWND_NULL, (HDC)-1, iItem) |
#define SetFocus SetFocusChild |
#define SetForegroundWindow SetActiveWindow |
Calculates the required size of the window rectangle based on the desired size of the client rectangle.
This function calculates the required size of the window rectangle, based on the desired size of the client rectangle. The window rectangle can then be passed to the CreateMainWindow or CreateWindow function to create a window whose client area is the desired size.
A client rectangle is the smallest rectangle that completely encloses a client area. A window rectangle is the smallest rectangle that completely encloses the window, which includes the client area and the nonclient area.
The AdjustWindowRectEx function does not add extra space when a menu bar wraps to two or more rows.
The AdjustWindowRectEx function takes the WS_VSCROLL or WS_HSCROLL styles into account.
pRect | Pointer to a RECT structure that contains the coordinates of the top-left and bottom-right corners of the desired client area. When the function returns, the structure contains the coordinates of the top-left and bottom-right corners of the window to accommodate the desired client area. |
dwStyle | Specifies the window style of the window whose required size is to be calculated. |
bMenu | Specifies whether the window has a menu. |
dwExStyle | Specifies the extended window style of the window whose required size is to be calculated. |
Prepares a window for painting.
This function prepares the specified window hWnd for painting. This function is called in the handler of MSG_PAINT message normally. It returns a device context including the update region of the window. When you are done with the device context, you should call EndPaint to finish the painting of the window.
hWnd | The handle to the window. |
Retrives a handle to the child window that contains the speicified point.
This function determines which, if any, of the child windows belonging to a parent window contains the specified point by calling ChildWindowFromPointEx and passing CWP_ALL to uFlags parameter.
Definition at line 6686 of file window.h.
References ChildWindowFromPointEx(), MoveWindow(), and ScrollWindowEx().
Retrives a handle to the child window that contains the speicified point and meets the certain criteria.
This function determines which, if any, of the child windows belonging to a parent window contains the specified point. The function can ignore invisible, disabled, and transparent child windows. The search is restricted to immediate child windows. Grandchildren, and deeper descendant windows are not searched.
hParent | Handle to the parent window. |
pt | Specifies a POINT structure that defines the client coordinates (relative to hParent) of the point to be checked. |
uFlags | Specifies which child windows to skip. This parameter can be one or more of the following values.
|
Referenced by ChildWindowFromPoint().
Calculates window height from the height of the client area.
This function calculates the main window height from the height of the client area.
dwStyle | The style of window. |
win_type | The type of window. |
ch | The height of the client area. |
hasMenu | Indicates whether the main window has menu. |
void GUIAPI ClientToScreen | ( | HWND | hWnd, |
int * | x, | ||
int * | y | ||
) |
Converts the client coordinates of a point to screen coordinates.
This function converts the client coordinates of the specified point (*x,*y) in the specified window hWnd to screen coordinates.
hWnd | The handle to the window. |
x | The pointer to the x coordinate. |
y | The pointer to the y coordinate. |
void GUIAPI ClientToWindow | ( | HWND | hWnd, |
int * | x, | ||
int * | y | ||
) |
Converts the client coordinates to the window coordinates.
This function converts the client coordinates of the specified point (*x,*y) in the specified window hWnd to the window coordinates.
hWnd | The handle to the window. |
x | The pointer to the x coordinate. |
y | The pointer to the y coordinate. |
int GUIAPI ClientWidthToWindowWidthEx | ( | DWORD | dwStyle, |
int | win_type, | ||
int | cw | ||
) |
Calculates main window width from the width of the client area.
This function calculates the window width from the width of the client area.
dwStyle | The style of window. |
win_type | The type of window. |
cw | The width of the client area. |
Enables of disables a window.
This function enables or disables mouse and keyboard input to the specified window hWnd. When input is disabled, the window does not receive input such as mouse clicks and key presses. When input is enabled, the window receives all input.
hWnd | The handle to the window. |
fEnable | Indicates whether to enable or disable the window, TRUE for enable. |
Marks the end of painting in a window.
This function marks the end of painting in the specified window. This function is required for each call to the BeginPaint function, but only after painting is complete.
hWnd | The handle to the window. |
hdc | The device context returned by BeginPaint. |
Removes the specific extended style of a window.
This function removes the specific extended style of the window specified by hWnd.
hWnd | The handle to the window. |
dwStyle | The specific extended style which will be removed. |
Removes the specific style of a window.
This function removes the specific style of the window specified by hWnd.
hWnd | The handle to the window. |
dwStyle | The specific style which will be removed. |
HWND GUIAPI GetActiveWindow | ( | void | ) |
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.
HWND GUIAPI GetCapture | ( | void | ) |
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.
Retrives the client rectangle of a window.
This function retrives the coordinates of the client area of the window specified by hWnd. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are always (0,0).
hWnd | The handle to the window. |
prc | The pointer to a RECT structure receives the client rectangle. |
Retrives the first hosted main window of a main window.
This function retrives the first hosted main window of the specified main window hMainWnd.
For MiniGUI-Threads, HWND_DESKTOP has no any "hosted" window, so do not use this function for it.
hHosting | The handle to the hosting main window. |
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.
hParent | The handle to the parent window. |
Retrives the hosting main window of a main window.
This function retrives the hosting main window of the specified main window hWnd. The hosting main window creates the message queue, which shared with all hosted main window of it. The hosting window of a top-level main window is HWND_DESKTOP.
HWND_DESKTOP has no hosting window, do not use this function for it.
hMainWnd | The handle to the main window. |
Retrives the handle to the main window contains a window.
This function retrives the handle to the main window which contains the specified window hWnd.
hWnd | The handle to the window. |
Retrives the next control in a window.
This function retrives the next child of the specified window hWnd. If you pass HWND_NULL for the argument of hChild, the function will return the first child of the window.
hWnd | The handle to the window. |
hChild | The handle to a child of the window. |
Example:
Retrives the next hosted main window of a main window.
This function retrives the next hosted main window of the specified main window hHosting.
For MiniGUI-Threads, HWND_DESKTOP has no any "hosted" window, so do not use this function for it.
hHosting | The handle to the hosting main window. |
hHosted | The handle to a known hosted main window. This function will return the next hosted main window. |
Retrives the next main window in the system according to the zorder.
This function retrives the next main window of the specified main window hMainWnd.
hMainWnd | The handle to the main window. |
Retrieves the handle to a child window's parent window.
This function retrieves the handle to the specified child window's parent window.
hWnd | The handle to the child window. |
Retrives the bounding box of the update region of a window.
This function retrives the bounding box of the update region of the specified window hWnd.
hWnd | The handle to the window. |
update_rect | The pointer to a RECT structure which will contains the bounding box of the update region. |
Copy the update region of a window to a region.
This function copies the update region of the specified window hWnd into the region pRgn.
hWnd | The handle to the window. |
pRgn | The pointer to a region which receives the update region of the window. |
NULLREGION | Region is empty. |
SIMPLEREGION | Region is a single rectangle. |
COMPLEXREGION | Region is more than one rectangle. |
-1 | An error occurred. |
Retrives the first additional data of a window.
This function retrives the first additional data of the specified window hWnd.
hWnd | The handle to the window. |
Retrives the second additional data of a window.
This function retrives the second additional data of the specified window hWnd.
hWnd | The handle to the window. |
Returns the current background color of a window.
This function returns the pixel value of the current background color of the window specified by hWnd.
hWnd | The handle to the window. |
Retrives the callback procedure of a window.
This function retrives the window callback procedure of the specified window hWnd.
hWnd | The handle to the window. |
const char *GUIAPI GetWindowCaption | ( | HWND | hWnd | ) |
Retrives the caption of a window.
This function retrives the caption of the specified window hWnd.
hWnd | The handle to the window. |
Retrives the additional data of a control class.
This function retrives the additional data of the control class to which the specified control hWnd belongs.
hWnd | The handle to the control. |
Retrives the current cursor of a window.
This function retrives the current cursor of the specified window hWnd.
hWnd | The handle to the window. |
Retrives the extended style of a window.
This function retrives the extended style of the window specified by hWnd.
hWnd | The handle to the window. |
Retrives the default font of a window.
This function retrives the default font of the specified window hWnd.
hWnd | The handle to the window. |
Retrives the current icon of a window.
This function retrives the current icon of the specified window hWnd.
hWnd | The handle to the window. |
Retrives the dimensions of the bounding rectangle of a window.
This function retrives the dimension of the bounding rectangle of the specified window hWnd. The dimensions are given in parent's client coordinates (screen coordinates for main window) that are relative to the upper-left corner of the parent's client area (screen).
hWnd | The handle to the window. |
prc | The pointer to a RECT structure which will contains the window rectangle. |
Retrives the style of a window.
This function retrives the style of the window specified by hWnd.
hWnd | The handle to the window. |
int GUIAPI GetWindowText | ( | HWND | hWnd, |
char * | spString, | ||
int | nMaxLen | ||
) |
Copies the text of a window's into a buffer.
This function copies the text of the specified window hWnd into the buffer pointed to by spString. The function gets the window text by sending an MSG_GETTEXT message to the window.
hWnd | The handle to the window. |
spString | The pointer to a buffer receives the text. |
nMaxLen | The maximal number of characters can be copied to the buffer. |
int GUIAPI GetWindowTextLength | ( | HWND | hWnd | ) |
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.
hWnd | The handle to the window. |
HWND GUIAPI GetWindowUnderCursor | ( | void | ) |
Retrives the handle to the window (if any) which is just beneath the mouse cursor.
This function retrieves the handle to the window (if any) that is under the mouse cursor. If a parent window and a child window are all under the mouse cursor, the handle to the child window will be returned.
Includes the specific extended style of a window.
This function includes the specific extended style of the window specified by hWnd.
hWnd | The handle to the window. |
dwStyle | The specific extended style which will be included. |
Includes the specific style of a window.
This function includes the specific style of the window specified by hWnd.
hWnd | The handle to the window. |
dwStyle | The specific style which will be included. |
Makes a rectangle region in the client area of a window invalid.
This function adds a rectangle pointed to by prc to the specified window's update region. The update region represents the portion of the window's client area that must be redrawn, and erase background if argument bReaseBkgnd is set.
hWnd | The handle to the window. |
prc | The pointer to a RECT structure which defines the invalid rectangle. |
bEraseBkgnd | Indicates whether the background should be erased. |
Invalidates the client area within the specified region.
This function invalidates the client area within the specified region by adding it to the current update region of a window. The invalidated region, along with all other areas in the update region, is marked for painting when the next MSG_PAINT message occurs.
hWnd | Handle to the window with an update region that is to be modified. |
pRgn | Pointer to the region to be added to the update region. The region is assumed to have client coordinates. If this parameter is NULL, the entire client area is added to the update region. |
bErase | Specifies whether the background within the update region should be erased when the update region is processed. If this parameter is TRUE, the background is erased. If the parameter is FALSE, the background remains unchanged. |
Determines whether a window is a control.
This function determines whether the specified window hWnd is a control.
hWnd | The handle to the window. |
Determines whether a window handle identifies a dialog window.
This function determines whether the specified window handle hWnd identifies a dialog window.
hWnd | The window handle. |
Determines whether a window handle identifies an existing window.
This function determines whether the specified window handle hWnd identifies an existing window.
hWnd | The window handle. |
Determines whether the specified window is enabled for mouse and keyboard input.
This function returns the enable/disable state of the window specified by hWnd.
hWnd | The handle to the window. |
Retrieves the visibility state of the specified window.
This function retrives the visibility state of the specified window hWnd.
hWnd | Handle to the window to test. |
Changes the position and dimensions of a window.
This function changes the position and dimensions of the specified window 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.
hWnd | The handle to the window. |
x | The new x coordinate of the upper-left corner of the window. |
y | The new y coordinate of the upper-left corner of the window. |
w | The new width of the window. |
h | The new height of the window. |
fPaint | Indicates whether the window should be repainted. |
Referenced by ChildWindowFromPoint().
void GUIAPI ReleaseCapture | ( | void | ) |
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.
void GUIAPI ScreenToClient | ( | HWND | hWnd, |
int * | x, | ||
int * | y | ||
) |
Converts the screen coordinates of a point to client coordinates.
This function converts the screen coordinates of the specified point (*x,*y) to client coordinates of the specified window hWnd.
hWnd | The handle to the window. |
x | The pointer to the x coordinate. |
y | The pointer to the y coordinate. |
void GUIAPI ScreenToWindow | ( | HWND | hWnd, |
int * | x, | ||
int * | y | ||
) |
Converts the screen coordinates of a point to window coordinates.
This function converts the screen coordinates of the specified point (*x,*y) to the window coordinates of the specfied window hWnd.
hWnd | The handle to the window. |
x | The pointer to the x coordinate. |
y | The pointer to the y coordinate. |
|
inlinestatic |
Scrolls the content of a window's client area.
This function scrolls the content of the specified window's client area.
hWnd | The handle to the window. |
dx | The new x coordinate of the origin in the client coordinates system after scrolling. |
dy | The new y coordinate of the origin in the client coordinates system after scrolling. |
prcScroll | The rectangle of the area which will be scrolled actually. NULL for whole client area. |
prcClip | A rectangle, all children covered totally by this rectangle will be moved after scrolling. All of the children will be moved if prcClip is NULL. |
Definition at line 6814 of file window.h.
References NULL, and ScrollWindowEx().
int GUIAPI ScrollWindowEx | ( | HWND | hWnd, |
int | dx, | ||
int | dy, | ||
const RECT * | prcScroll, | ||
const RECT * | prcClip, | ||
PCLIPRGN | pRgnUpdate, | ||
PRECT | prcUpdate, | ||
UINT | flags | ||
) |
Scrolls the content of a window's client area.
This function scrolls the content of a window's client area.
If the SW_INVALIDATE and SW_ERASE flags are not specified, ScrollWindowEx does not invalidate the area that is scrolled from. If either of these flags is set, ScrollWindowEx invalidates this area. The area is not updated until the application calls the UpdateWindow function or retrieves the MSG_PAINT message from the application queue.
If the window has the WS_CLIPCHILDREN style, the returned areas specified by pRgnUpdate and prcUpdate represent the total area of the scrolled window that must be updated, including any areas in child windows that need updating.
If the SW_SCROLLCHILDREN flag is specified, the system does not properly update the screen if part of a child window is scrolled. The part of the scrolled child window that lies outside the source rectangle is not erased and is not properly redrawn in its new destination. To move child windows that do not lie completely within the rectangle specified by prcScroll, use the DeferWindowPos function. The cursor is repositioned if the SW_SCROLLCHILDREN flag is set and the caret rectangle intersects the scroll rectangle.
All input and output coordinates (for prcScroll, prcClip, prcUpdate, and pRgnUpdate) are determined as client coordinates.
hWnd | Handle to the window where the client area is to be scrolled. |
dx | Specifies the amount, in device units, of horizontal scrolling. This parameter must be a negative value to scroll to the left. |
dy | Specifies the amount, in device units, of vertical scrolling. This parameter must be a negative value to scroll up. |
prcScroll | Pointer to a RECT structure that specifies the portion of the client area to be scrolled. If this parameter is NULL, the entire client area is scrolled. |
prcClip | Pointer to a RECT structure that contains the coordinates of the clipping rectangle. Only device bits within the clipping rectangle are affected. Bits scrolled from the outside of the rectangle to the inside are painted; bits scrolled from the inside of the rectangle to the outside are not painted. This parameter may be NULL. |
pRgnUpdate | Pointer to the region that is modified to hold the region invalidated by scrolling. This parameter may be NULL. |
prcUpdate | Pointer to a RECT structure that receives the boundaries of the rectangle invalidated by scrolling. This parameter may be NULL. |
flags | Specifies flags that control scrolling. This parameter can be one of the following values:
|
Referenced by ChildWindowFromPoint(), and ScrollWindow().
Sets a main window to be the active main window.
This function sets the specified main window hMainWnd to be the active main window which receives the input.
hMainWnd | The handle to the new active main window. |
Sets the mouse capture to the specified window.
This function sets the mouse capture to the specified window 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.
hWnd | The handle to the window. |
Sets the active child of a window.
This function sets the specified window hWnd as the active child of its parent.
hWnd | The handle to the window. |
Cancels the current active child and set the focus child to be null.
This function cancels the current active child and set the focus child of the window hParent to be null.
hParent | The handle to the parent window. |
Sets the first additional data of a window.
This function sets the first additional data of the specified window hWnd.
hWnd | The handle to the window. |
newData | The new first additional data of the window. |
Sets the second additional data of a window.
This function sets the second additional data of the specified window hWnd.
hWnd | The handle to the window. |
newData | The new second additional data of the window. |
Sets the background color of a window.
This function sets the background color of the specified window hWnd to be new pixel value new_backcolor. You should call UpdateWindow or InvalidateRect in order that the new background color runs into affect.
hWnd | The handle to the window. |
new_bkcolor | The pixel value of the new background color. |
Sets the callback procedure of a window.
This function sets the window callback procedure of the specified window hWnd to be the procedure newProc.
hWnd | The handle to the window. |
newProc | The new callback procedure of the window. |
Example:
Sets the caption of a window.
This function sets the caption of the specified window hWnd.
hWnd | The handle to the window. |
spCaption | The pointer to the new caption of the window. |
Sets the additional data of a control class.
This function sets the additional data of the control class to which the specified control hWnd belongs.
hWnd | The handle to the control. |
newData | The new additional data of the control class. |
Sets the current cursor of a window.
This function sets the current cursor of the specified window hWnd with argument hNewCursor.
hWnd | The handle to the window. |
hNewCursor | The handle to the new cursor. |
Sets the default font of a window.
This function sets the default font of the specified window hWnd to be the logical font pLogFont. This function will send an MSG_FONTCHANGING message to the window. If the handler of the message returns non-zero value, this function will return immediately with the unchanged default font. Or, after the new default font set, this function will send an MSG_FONTCHANGED message to the window as a notification.
hWnd | The handle to the window. |
pLogFont | The new default logical font. If it is NULL, this function will set the default font to be the system wchar font. |
Sets the current icon of a window.
This function sets the current icon of the specified window hWnd with argument hIcon.
hWnd | The handle to the window. |
hIcon | The handle to the new icon. |
bRedraw | Indicates whether to update the whole window. |
Sets the text of a window.
This function copies the string in the buffer pointed to by spString to be the text of the specified window hWnd. The function sets the window text by sending an MSG_SETTEXT message to the window.
hWnd | The handle to the window. |
spString | The pointer to the buffer. |
Shows or hides a window.
This function shows or hides the window specified by hWnd.
hWnd | The handle to the window. |
iCmdShow | The command to show or hide, can be one of the following values:
|
Updates a window.
This function updates the window specified by hWnd. It will redraw the caption, the frame, and the menu bar of the window. It will invalidate the client area of the window as well, and if bErase is TRUE, the client area will be erased by using background color.
hWnd | The handle to the window. |
bErase | Indicates whether to erase the client area of the window. |
Validates the client area within a rectangle by removing the rectangle from the update region of the specified window.
This function validates the client area within a rectangle by removing the rectangle from the update region of the specified window.
hWnd | Handle to the window whose update region is to be modified. |
rect | Pointer to a RECT structure that contains the client coordinates of the rectangle to be removed from the update region. If this parameter is NULL, the entire client area is removed. |
Validates the client area within a region by removing the region from the current update region of the specified window.
This function validates the client area within a region by removing the region pRgn from the current update region of the specified window hWnd.
hWnd | Handle to the window whose update region is to be modified. |
pRgn | A region that defines the area to be removed from the update region. If this parameter is NULL, the entire client area is removed. |
Retrieves a handle to the window that contains the specified point.
This function retrieves a handle to the main window that contains the specified point pt.
pt | Specifies a POINT structure that defines the point to be checked. |
bRecursion | Try find the child window of the mMainWindow |
void GUIAPI WindowToClient | ( | HWND | hWnd, |
int * | x, | ||
int * | y | ||
) |
Converts the window coordinates to client coordinates.
This function converts the window coordinates of the specified point (*x,*y) in the specified window hWnd to the client coordinates.
hWnd | The handle to the window. |
x | The pointer to the x coordinate. |
y | The pointer to the y coordinate. |
void GUIAPI WindowToScreen | ( | HWND | hWnd, |
int * | x, | ||
int * | y | ||
) |
Converts the window coordinates of a point to screen coordinates.
This function converts the window coordinates of the specified point (*x,*y) in the specified window hWnd to the screen coordinates.
hWnd | The handle to the window. |
x | The pointer to the x coordinate. |
y | The pointer to the y coordinate. |