function LoadAniCursor(ani: string): integer;
begin
result := LoadImage(0, PChar(ani), IMAGE_CURSOR,
0, 0, LR_DEFAULTSIZE or LR_LOADFROMFILE);
end;
// Beispielaufruf
procedure TForm1.Button1Click(Sender: TObject);
var
h, idx: integer;
begin
h := LoadAniCursor('c:\windows\cursors\metronom.ani');
if h = 0 then
ShowMessage('FEHLER') else begin
idx := 100;
Screen.Cursors[idx] := h;
Button1.cursor := idx;
Form1.cursor := idx;
end;
end;