Mobile Development: A battery monitor for the taskbar
Hello
this time I will show how I did a battery monitor that shows on the taskbar. The C source code uses the drawing functions DrawRect and Polygon to draw a battery symbol onto the taskbar. The drawing is updated every second by a background thread, that queries the battery status using GetSystemPowerStatusEx2. The thread then sends the battery flag reading using SendMessage with WM_USER.
Why did I write an app that already exists? If you look at your windows mobile taskbar, you will find, that the battery or the clock disappear from the taskbar. They will not be visible in all programs, depending on the space left on the taskbar. If you need to have a battery monitor that is shown all the time, this one may be for you. It will just show all the time on top of the taskbar.
The code
The drawings are done from arrays of POINT or RECT structures. So it is easy to change the drawings:
Continue reading ‘Mobile Development: A battery monitor for the taskbar’ »