2010
07.22

Now that I am using a Windows Mobile based device, it is really annoying that the media player does not have a sleep timer included.  I noticed that many years ago in an iPaq PDA, and I see that nothing has changed.

When I go to sleep, I start the Windows Media Player usually with a large playlist, or even the loop function activated. I do not want, however, the device playing all night long wasting my battery… Well, it’s the very definition of Sleep Timer, ain’t it?

I put together a couple of lines of code, and made this **extremely basic** sleep timer. I did something similar many years ago for the iPaq, and now I’ve don it again. I spent more time trying to make the cab installer that the code itself:D. The code is almost worthless to put here, but I’ll do it just in case someone wants to modify it to start a different process other than the Media Player.

The “Suspend the device” function, calls the SetSystemPowerState API which according to the MSDN its effect may vary on each device, as it relies on some OEM power management implementation. It will not be necessary in most of modern devices, but I included it just in case.

Sleep Timer Installer

Sleep Timer Source Code

No Comment.

Add Your Comment