procedure TForm1.Button1Click(Sender:
TObject);
begin
//アニメーションカーソルのハンドルを取得
hAni := LoadImage(hInstance, 'Hourglas.ani',IMAGE_CURSOR,0,0, LR_LOADFROMFILE
) ;
//アニメーションカーソルの再生用ウインドウを作成
hStatic := CreateWindowEx(0,'Static', nil,
WS_CHILD Or WS_VISIBLE Or SS_ICON ,
150,150,32,32,Form1.Handle,0 ,hInstance,nil);
//再生
SendMessage(hStatic, STM_SETIMAGE, IMAGE_CURSOR,hAni);
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
//解放
DestroyCursor(hAni);
DestroyWindow(hStatic)
end;
|