I want to fix the system cursor on Windows as accurately as possible. The API provided for this, to my knowledge, is GetCursorInfo, DrawIconEx.
Simple chain of actions:
- Get cursor using GetCursorInfo
- Draw a cursor in DC memory using DrawIconEx.
Here's what the code looks like.
CURSORINFO CursorInfo;
(VOID)memset(&CursorInfo, 0, sizeof(CursorInfo));
CursorInfo.cbSize = sizeof(CursorInfo);
if (GetCursorInfo(&CursorInfo) &&
CursorInfo.hCursor)
{
boError |= !DrawIconEx(hCursorDC,
0,
0,
CursorInfo.hCursor,
0,
0,
0,
NULL,
DI_MASK | DI_DEFAULTSIZE);
}
Now does anyone know how I can get which step of the animation cursor is drawn (I need a value that can then be passed to the istepIfAniCur DrawIconEx ... parameter)? Currently, the above code, obviously, always displays only the first step of the animated cursor.
I suspect this is not easy to do, but still worth asking.
source
share