Search code examples
c++windowswindows-xpmouse-cursor

How to modify one's cursor through C++ Windows Console


I wish to create a new cursor to be used with my program. I want to make the cursor appear as a circle that I have already made, but I can't seem to get it to temporarily change to it when only using the game window, and I also can't get it to stay overtop of the normal cursor. Please, is there a way to change the cursor in c++ based on if it's over a certain window? The only methods I found used system commands, which are a security issues, and have not changed it back. I have had to go in and manually change the cursor back every time I finish with the program. Thanks in advance, and if you have any questions or I am unclear, please say so!


Solution

  • You can change the cursor in window by using LoadCursorFromFile and SetCursor.

    You will need to create .ANI file that describes the cursor, you can read more about it here.