Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 5938 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

You can either load it from a resource or a file on your hard disk.
To get a cursor into a RES file, use the editor that comes with Delphi (In delphi click Tools -> Image Editor) or borland''s resource compiler (also comes with Delphi, can be found in the BIN directory).

to load a cursor you have to declare a cursor constant first, for example

crCoolCursor = 5;

now if you''re loading your cursor from a RES file, do it like this:

Screen.Cursors[crCoolCursor] := LoadCursor(HInstance, ''CoolCursor'');

you can load a resource like this


way up where the other compiler directives are.

to load a cursor from a cursor file (.CUR or .ANI), do the following:

Screen.Cursors[crCoolCursor] := LoadCursorFromFile(PChar(''C:\cool.cur'');

once the cursor is loaded, you can do this:

Form1.Cursor := crCoolCursor; or
Screen.Cursor := crCoolCursor;

loading cursors from RES files is more elegant since it won''t require any files to be stored outside the EXE.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!