MiniGUI API Reference (MiniGUI-Standalone)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Functions
Caret operations

Functions

MG_EXPORT BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight)
 Creates a new shape for the system caret and assigns ownership of the caret to the specified window. More...
 
MG_EXPORT BOOL GUIAPI ChangeCaretSize (HWND hWnd, int newWidth, int newHeight)
 Changes the size of the caret. More...
 
MG_EXPORT BOOL GUIAPI ActiveCaret (HWND hWnd)
 Activates the caret owned by a window. More...
 
MG_EXPORT UINT GUIAPI GetCaretBlinkTime (HWND hWnd)
 Returns the elapsed time, in milliseconds, required to invert the caret's pixels. More...
 
MG_EXPORT BOOL GUIAPI SetCaretBlinkTime (HWND hWnd, UINT uTime)
 Sets the caret blink time to the specified number of milliseconds. More...
 
MG_EXPORT BOOL GUIAPI DestroyCaret (HWND hWnd)
 Destroys a caret. More...
 
static BOOL GUIAPI HideCaret (HWND hWnd)
 Hides a caret. More...
 
MG_EXPORT BOOL GUIAPI ShowCaretEx (HWND hWnd, BOOL ime)
 Shows a caret. More...
 
static BOOL GUIAPI ShowCaret (HWND hWnd)
 Shows a caret. More...
 
MG_EXPORT BOOL GUIAPI SetCaretPos (HWND hWnd, int x, int y)
 Moves the caret to a new position. More...
 
MG_EXPORT BOOL GUIAPI GetCaretPos (HWND hWnd, PPOINT pPt)
 Gets the caret position. More...
 

Detailed Description

Function Documentation

BOOL GUIAPI ActiveCaret ( HWND  hWnd)

Activates the caret owned by a window.

This function activates the caret owned by the specified window hWnd. After activating the caret, the caret will begin flashing automatically.

Parameters
hWndThe owner of the caret.
Returns
TRUE on success, otherwise FALSE.
See also
HideCaret, ShowCaret
BOOL GUIAPI ChangeCaretSize ( HWND  hWnd,
int  newWidth,
int  newHeight 
)

Changes the size of the caret.

This function change the size of the caret owned by the specified window hWnd. Note that the new size of the caret should be smaller than the original size which is specified when you call CreateCaret.

Parameters
hWndThe owner of the caret.
newWidthThe new width of the caret.
newHeightThe new height of the caret.
Returns
TRUE on success, otherwise FALSE.
See also
CreateCaret
BOOL GUIAPI CreateCaret ( HWND  hWnd,
PBITMAP  pBitmap,
int  nWidth,
int  nHeight 
)

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 hWnd. The caret shape can be a line, a block, or a bitmap.

Parameters
hWndThe owner of the caret.
pBitmapThe bitmap shape of the caret. It can be NULL.
nWidthThe width of the caret.
nHeightThe height of the caret.
Returns
TRUE on success, otherwise FALSE.
See also
ActiveCaret, ChangeCaretSize
BOOL GUIAPI DestroyCaret ( HWND  hWnd)

Destroys a caret.

This function destroys the caret's current shape, frees the caret from the window, and removes the caret from the screen.

Parameters
hWndThe owner of the caret.
Returns
TRUE on success, otherwise FALSE.
See also
CreateCaret
UINT GUIAPI GetCaretBlinkTime ( HWND  hWnd)

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.

Parameters
hWndThe owner of the caret.
Returns
The elapsed time in milliseconds. Returns zero on error.
See also
SetCaretBlinkTime
BOOL GUIAPI GetCaretPos ( HWND  hWnd,
PPOINT  pPt 
)

Gets the caret position.

This function copies the caret's position, in client coordinates, to the specified POINT structure pPt.

Parameters
hWndThe owner of the caret.
pPtThe pointer to the buffer saves the caret's position.
Returns
TRUE on success, otherwise FALSE.
See also
SetCaretPos

Referenced by ShowCaret().

BOOL GUIAPI HideCaret ( HWND  hWnd)
inlinestatic

Hides a caret.

This function removes the caret from the screen and close the IME window. Hiding a caret does not destroy its current shape or invalidate the insertion point.

Parameters
hWndThe owner of the caret.
Returns
TRUE on success, otherwise FALSE.
See also
ShowCaret

Definition at line 8254 of file window.h.

References ShowCaretEx(), and TRUE.

BOOL GUIAPI SetCaretBlinkTime ( HWND  hWnd,
UINT  uTime 
)

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.

Parameters
hWndThe owner of the caret.
uTimeNew blink time in milliseconds.
Returns
TRUE on success, otherwise FALSE.
See also
GetCaretBlinkTime
BOOL GUIAPI SetCaretPos ( HWND  hWnd,
int  x,
int  y 
)

Moves the caret to a new position.

This function moves the caret to the specified coordinates (x,y).

Parameters
hWndThe owner of the caret.
xx,y: The position of the caret in client coordiantes of the owner window.
yx,y: The position of the caret in client coordiantes of the owner window.
Returns
TRUE on success, otherwise FALSE.
See also
GetCaretPos

Referenced by ShowCaret().

BOOL GUIAPI ShowCaret ( HWND  hWnd)
inlinestatic

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.

Parameters
hWndThe owner of the caret.
Returns
TRUE on success, otherwise FALSE.
See also
HideCaret

Definition at line 8292 of file window.h.

References GetCaretPos(), SetCaretPos(), ShowCaretEx(), and TRUE.

BOOL GUIAPI ShowCaretEx ( HWND  hWnd,
BOOL  ime 
)

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.

Parameters
hWndThe owner of the caret.
imeTRUE if you want to let the hidden IME window (if there is any) show up at the same time.
Returns
TRUE on success, otherwise FALSE.
See also
HideCaretEx

Referenced by HideCaret(), and ShowCaret().