Solved

Cursor help

Posted on 1998-09-05
1
187 Views
Last Modified: 2010-04-04
I need to insert my cursor in delphi project
0
Comment
Question by:ILPowerSoft
1 Comment
 
LVL 8

Accepted Solution

by:
ZifNab earned 20 total points
ID: 1338666
Hi ILPowerSoft,

Install custom cursor


Put the cursor in a .RES file. Make sure that the name of the cursor is ALL UPPERCASE, and make sure that the name of the .RES file is NOT the same as the name of your project's .DPR file. Link the .RES file into your project by adding the MYRES.RES to your source as :

 {$R *.RES}
 {$R MYRES.RES}

Use the LoadCursor API function to retrieve your cursor, using hInstance as the first parameter. The "Cursors property" online help has the information on the remaining steps required to make the cursor available to your application.

Here is the code to load the cursor.
procedure TForm1.FormCreate(Sender: TObject);begin
  Screen.Cursors [crMyCursor] := LoadCursor (hInstance, 'MYCURSOR'); //MYCURSOR is name of cursor in MYRES.RES
  Cursor := crMyCursor;
end;

Screen.Cursors [crCursor] := LoadCursor (hInstance, 'MYCURSOR');

Regards, Zif.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question