i am trying to get my (global) mouse cursor icon in a QPixmap.
After reading the Qt and MSDN documentation i came up with this piece of code:
I am unsure about mixing HCURSOR and HICON but i have seen some examples where they do it.
QPixmap MouseCursor::getMouseCursorIconWin()
{
CURSORINFO ci;
ci.cbSize = sizeof(CURSORINFO);
if (!GetCursorInfo(&ci))
qDebug() << "GetCursorInfo fail";
QPixmap mouseCursorPixmap = QtWin::fromHICON(ci.hCursor);
qDebug() << mouseCursorPixmap.size();
return mouseCursorPixmap;
}
However, my mouseCursorPixmap size is always QSize(0,0). What goes wrong?