Главная страница | назад

Article #17121: Cursor, Animated

 Question and Answer Database

FAQ2121C.txt   Cursor, Animated
Category   :VCL
Platform    :All
Product    :C++Builder  1.x

How do use an animated cursor?

You will first need to get a handle to a Windows cursor and
assign it to the TScreen component's Cursors array.

Predefined cursors start at a negative index, and user defined
custom cursors are assigned positive indexes.

The following is an example of a CBuilder form that uses an 
animated cursor:

void __fastcall TForm1::Button1Click(TObject *Sender)
    HCURSOR hand;
    hand = LoadCursorFromFile("c:\\winnt\\cursors\\Drum.ani");

    if (hand == NULL)
        ShowMessage("Cursor not loaded.");
       Screen->Cursors[1] = hand;
       Form1->Cursor = (Controls::TCursor)1;

7/2/98 10:32:32 AM

Last Modified: 01-SEP-99