I'm trying to change the default OS cursor to a custom one. As of now, I'm only dealing with Windows. I got an image file with the cursor I want (.png, should I change format?). All in all, I've been searching and trying to simply change the cursor, with no success. Also, as of now I'm looking for the most simple solution, with as few line of codes as possible.
If relevant:
-I'm using a window created with SFML(2.1).
-The following compiles but makes no difference:
HCURSOR hCursor = LoadCursor(NULL, "path/filename.png");
SetCursor(hCursor);
So, I'm seeking the knowledge of the community, any ideas?
The following works :) It does however immediately revert back to default windows mouse:
HCURSOR hCursor = LoadCursorFromFile("path/filename.cur");
SetCursor(hCursor);
I found this LINK, which seems to be the same problem as mine.
I am however unable to apply the answer given in the link
HWND windowHandle;
int GCL_Hcursor = -12; //GCL_HCURSOR
HCURSOR hCursor = LoadCursorFromFile("Graphics/Cursors/Pointer_small.cur");
SetCursor(hCursor);
SetClassLong(windowHandle, GCL_Hcursor, (DWORD)hCursor);
I (obviously?) get:
uninitialized local variable 'windowHandle' used