Lets say that the application was shown to a teacher who wanted the sound to be muted. This is a good idea.
Basically, the logic to create a variable (SoundOn) that holds a boolean value. Next, create something for the user to click to turn the sound on or off. When the user clicks the item and the sound is on, turn the sound off. When the user clicks the item and the sound is off, then turn the sound on. The code looks something like this.
if SoundOn = True then
SoundOn := False;
else
SoundOn := True;
Next add an if statement that would tell the sound to play or not depending on the boolean value.
Example: (Windows Code)
if SoundOn = True then
PlaySound('Sound/Oops.wav',0,SND_ASYNC);
Changing the cursor is as simple as:
lblSound.Cursor := crHandPoint;
The code for the Quick Clock Quizzer can be download on the Tutorial 32 page
Video: Free Pascal Tutorial 30 - Changing Cursors and Muting Sound - Quick Clock Quizzer - Lazarus
