Hi,
I have written a small program to repeatedly give an audible alarm when there are unread (SMS) messages.
The program runs in principle in the background using ShowTodayScreen and reads from the Registry on intervals based on a timer (Check timer) the unread message count.
When this count is > than 0, the form is shown indicating the number of unread messages and another timer (Sound timer) is started to play repeatedly a small wave file with increasing intervals.
More in detail, when the Check timer fires, the program:
-Puts backlight on
-Shows the screen
-On the added formactivated event it checks the orientation and reorganizes the form when the orientation has changed (only two controls)
-The Check timer is disabled
-The Sound timer is enabled
When the Sound timer fires:
-The form is shown
-Formactivated is executed
-The required interval for playing is checked
-The sound is played
With pressing a button the user can indicate that he has read the count information. Then the Sound timer is disabled, the Check timer is enabled, backlight is set to normal and ShowTodayScreen is activated again.
The program runs fine until the user puts off the backlight manually.
Then the tick event routine of the Sound timer is executed as usual , however the sound is not played.
Sometimes, the sound is played one or more times when the program is sent to background as if the play commands are on stock!
Does somebody have an explanation of this behaviour and a remedy?
Harry
I have written a small program to repeatedly give an audible alarm when there are unread (SMS) messages.
The program runs in principle in the background using ShowTodayScreen and reads from the Registry on intervals based on a timer (Check timer) the unread message count.
When this count is > than 0, the form is shown indicating the number of unread messages and another timer (Sound timer) is started to play repeatedly a small wave file with increasing intervals.
More in detail, when the Check timer fires, the program:
-Puts backlight on
-Shows the screen
-On the added formactivated event it checks the orientation and reorganizes the form when the orientation has changed (only two controls)
-The Check timer is disabled
-The Sound timer is enabled
When the Sound timer fires:
-The form is shown
-Formactivated is executed
-The required interval for playing is checked
-The sound is played
With pressing a button the user can indicate that he has read the count information. Then the Sound timer is disabled, the Check timer is enabled, backlight is set to normal and ShowTodayScreen is activated again.
The program runs fine until the user puts off the backlight manually.
Then the tick event routine of the Sound timer is executed as usual , however the sound is not played.
Sometimes, the sound is played one or more times when the program is sent to background as if the play commands are on stock!
Does somebody have an explanation of this behaviour and a remedy?
Harry