I am trying to get a HANDLE to the global cursor. Therefore I use the Windows function "GetCursorInfo". The return value of the function is nonzero, which implies that it succeeded. However, the HANDLE to the cursor returned is NULL.
This is the code I am using:
CURSORINFO ci;
ci.cbSize = sizeof(ci);
if (!GetCursorInfo(&ci)) {
cout << "GetCursorInfo() failed" << endl;
return 1;
}
cout << ci.hCursor << endl; // ci.hCursor is 0x00000000
I am only getting this error on my Intel NUC with Windows 10 (not on a normal PC with Windows 10).
I cannot find this error anywhere else so help would be very appreciated!
Thank you!
Ok I have figured out why this is happening:
I am connecting to my Intel NUC remotely and therefore don't have a physical mouse connected. This appears to cause the problem. As soon as I connect a physical mouse everything works as intended again.
Windows seems to be switching to tablet mode once there is no mouse connected and therefore hides the cursor.
User contributions licensed under CC BY-SA 3.0