I want for my users to hear a sound when my application is
shut down. It's just a simple .wav. What I do is this.
I first assign the location of the .wav to the mediaplayer
named sound. Then I check if the file exists, if it exists,
the sound is played, otherwise nothing happens. Now this
works as a normal button click procedure but it doesnt under any of the forms events.
procedure TForm1.FormDestroy(Sender: TObject);
begin
Sound.FileName := 'C:\WINDOWS\MEDIA\LOGGOFF.WAV';
if FileExists(Sound.FileName) then
Sound.Play;
end;
your help is appreciated ;-)
;-) BobbaFet ;-)
Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net
shut down. It's just a simple .wav. What I do is this.
I first assign the location of the .wav to the mediaplayer
named sound. Then I check if the file exists, if it exists,
the sound is played, otherwise nothing happens. Now this
works as a normal button click procedure but it doesnt under any of the forms events.
procedure TForm1.FormDestroy(Sender: TObject);
begin
Sound.FileName := 'C:\WINDOWS\MEDIA\LOGGOFF.WAV';
if FileExists(Sound.FileName) then
Sound.Play;
end;
your help is appreciated ;-)
;-) BobbaFet ;-)
Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net