I'm trying to change the cursor of my mouse with a .cur file in a resource file.
When I'm try my code, I get this error:
Exception raised at 0x77EB7392 (ntdll.dll) in CleanResourceFiles.exe: 0xC0000005: Access Violation while reading location 0x00000066.
Here is the code:
HCURSOR curs = (HCURSOR)LoadImage(NULL, MAKEINTRESOURCE(IDC_CURSOR1), 2, 0, 0, LR_LOADFROMFILE);
SetSystemCursor(curs, 32512);
Note : IDC_CURSOR1
is my cursor and 32512
is the ID of the classic arrow cursor. I also included <Windows.h>
and my resource.h
.
I'm using Visual Studio Community 2017, with Win10.
I tried other functions, like LoadCursor()
. The code above is from "VineMemz".
Finally, when I tried to change my cursor with LoadFromFile()
using the path to my .cur
file, it works.