Board index » delphi » Custom cursors...how to?

Custom cursors...how to?

Thanks everyone for the help about "hotspots", it still doesn't work, but I
will remove that part of my program...

Now, I got another question. I am using D2, and I know there is a way to
draw your own cursor, and to use it whenever you want - for example when you
place a mouse cursor over an button....

I also know that it should be all explained in help file, but... My helpfile
doesn't work (win32) and I don't know how to load my resource file...
Something like an API loadfile but hmm.. Could you write an small sample how
to load an resource file and a cursor from it?

Any tips and help would be apreciated.

Delphi Bosnia

 

Re:Custom cursors...how to?


a. Make a .res file with the cursor in it.
b. Link the .res file to your project with: {$R filename.res}
c. Load the cursor (e.g. resource name MYCURSOR) with:

Screen.SetCursors(x, LoadCursor(Instance, 'MYCURSOR'));

d. The x value you selected in the previous call can be used as the Cursor
property (remember that some cursor values are already used !).

"Atif Colo" <webmas...@gorazde.20m.com> schreef in bericht
news:8kar31$pp312@ns4.bih.net.ba...

Quote
> Thanks everyone for the help about "hotspots", it still doesn't work, but
I
> will remove that part of my program...

> Now, I got another question. I am using D2, and I know there is a way to
> draw your own cursor, and to use it whenever you want - for example when
you
> place a mouse cursor over an button....

> I also know that it should be all explained in help file, but... My
helpfile
> doesn't work (win32) and I don't know how to load my resource file...
> Something like an API loadfile but hmm.. Could you write an small sample
how
> to load an resource file and a cursor from it?

> Any tips and help would be apreciated.

> Delphi Bosnia

Other Threads