1.系统光标类型定义:
在../minigui/minigui.h文件中定义#define MAX_SYSCURSORINDEX 22
/* System cursor index. */
/** System arrow cursor index. */
#define IDC_ARROW 0
/** System beam cursor index. */
#define IDC_IBEAM 1
/** System pencil cursor index. */
#define IDC_PENCIL 2
/** System cross cursor index. */
#define IDC_CROSS 3
/** System move cursor index. */
#define IDC_MOVE 4
/** System size northwest to southeast cursor index. */
#define IDC_SIZENWSE 5
/** System size northeast to southwest cursor index. */
#define IDC_SIZENESW 6
/** System west to east cursor index. */
#define IDC_SIZEWE 7
/** System north to south cursor index. */
#define IDC_SIZENS 8
/** System up arrow cursor index. */
#define IDC_UPARROW 9
/** System none cursor index. */
#define IDC_NONE 10
/** System help cursor index. */
#define IDC_HELP 11
/** System busy cursor index. */
#define IDC_BUSY 12
/** System wait cursor index. */
#define IDC_WAIT 13
/** System right arrow cursor index. */
#define IDC_RARROW 14
/** System colomn cursor index. */
#define IDC_COLOMN 15
/** System row cursor index. */
#define IDC_ROW 16
/** System drag cursor index. */
#define IDC_DRAG 17
/** System nodrop cursor index. */
#define IDC_NODROP 18
/** System hand point cursor index. */
#define IDC_HAND_POINT 19
/** System hand select cursor index. */
#define IDC_HAND_SELECT 20
/** System horizontal split cursor index. */
#define IDC_SPLIT_HORZ 21
/** System vertical cursor index. */
#define IDC_SPLIT_VERT 22
2.获取系统某一个类型的光标
MG_EXPORT HCURSOR GUIAPI GetSystemCursor (int csrid);
* \param csrid The identifier of the system cursor.
* \return Handle to the system cursor, otherwise zero.
3.获取当前光标
MG_EXPORT HCURSOR GUIAPI GetCurrentCursor (void);
*\return Handle to the current system cursor, zero means no current cursor.
4.设置与获取光标的位置:
MG_EXPORT void GUIAPI SetCursorPos (int x, int y);
MG_EXPORT void GUIAPI GetCursorPos (POINT* ppt);
5.设置与获取光标剪裁区域
MG_EXPORT void GUIAPI ClipCursor (const RECT* prc);//sets cursor's clipping rectangle
MG_EXPORT void GUIAPI GetClipCursor (RECT* prc);//Gets the current cursor clipping rectangle
6.设置与获取光标类型:
#define SetCursor(hcsr) SetCursorEx (hcsr, FALSE) //Changes the current cursor
#define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE) //Changes the current cursor, and set it as the default cursor
MG_EXPORT HCURSOR GUIAPI GetDefaultCursor (void);//Gets the default cursor
例如:
设置系统默认光标:
HCURSOR hOldCursor;
hOldCursor = SetDefaultCursor (GetSystemCursor (IDC_WAIT));
设置当前显示光标:
SetCursor (GetSystemCursor (IDC_WAIT));
在主窗体创建时对MAINWINCREATE中光标参数的设置:
CreateInfo.hCursor = GetSystemCursor(IDC_ROW);
CreateInfo.hCursor = GetSystemCursor(0);
7.显示与隐藏光标:
MG_EXPORT int GUIAPI ShowCursor (BOOL fShow);//Shows or hides cursor