Author: Tomas Rutkauskas
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.
1 procedure TForm1.FormResize(Sender: TObject);
2 begin3 case WindowStatus of4 wsMinimized: sndPlaySound('min.wav', );
5 wsMaximized: sndPlaySound('max.wav', );
6 end;
7 end;