Problem/Question/Abstract:
How to play a WAV file when minimizing or maximizing a window
Answer:
Try the API SndPlaySound. It works fine without the need of visible components. Use the OnResize event and check WindowStatus for any changes.
procedure TForm1.FormResize(Sender: TObject);
begin
case WindowStatus of
wsMinimized: sndPlaySound('min.wav', );
wsMaximized: sndPlaySound('max.wav', );
end;
end;
Nincsenek megjegyzések:
Megjegyzés küldése