community.borland.com

Article #16075: Loading a Custom Cursor from a RES File

 Technical Information Database

TI1075D.txt   Loading a Custom Cursor from a RES File
Category   :VCL
Platform    :All
Product    :Delphi  All

Description:
Q:  How do I use one of the cursor files in the 
    c:\delphi\images\cursors?

A:  Use the image editor to load the cursor into a RES file.
    The following example assumes that you saved the cursor in the 
    RES file as "cursor_1", and you save the RES file as MYFILE.RES.
    
(*** BEGIN CODE ***)
{$R c:\programs\delphi\MyFile.res}   { This is your RES file }

const PutTheCursorHere_Dude = 1;     { arbitrary positive number }

procedure stuff;
begin
  screen.cursors[PutTheCursorHere_Dude] := LoadCursor(hInstance, 
                                             PChar('cursor_1'));
  screen.cursor := PutTheCursorHere_Dude;
end;




Reference:


7/16/98 4:34:00 PM
 

Last Modified: 01-SEP-99