PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Battery notification problem

Hello all,

I have two questions:
I'm trying to make the game frame so that it doesn't allow the low battery notification window to appear, because that wasts the game experience. Instead, I want to draw my own 'low battery' icon.
My questions;
1. How should my event handling look if I want to block all other applications?
2. How can I determine how much power the battery has left?

- Jacco.
OK, I now have this:

Code:

case WM_ACTIVATE:
case WM_ENABLE:
case WM_CREATE:
case WM_SETTINGCHANGE:
SetForegroundWindow( a_HWND );
break;


This seems to work well. Notifications still flash slightly, but they don't seem to cause problems. Is it possible to prevent this flashing?

One last thing that I added: If the game app is not the foreground window, I don't do the screen update. This shouldn't be neccessary, but I do it just in case; otherwise the app would crash when another window is in the foreground.

That still leaves the battery problem, of course. :)

- Jacco.
Ciao Jacco,
do you recognize me? (the contract is on the way... :mrgreen:)

You should look for one of
GetSystemPowerStatusEx or
GetSystemPowerStatusEx2 or
CeGetSystemPowerStatusEx
on the evc help...
Of course, it's Umberto, the migthy Asterox coder. :) Thanks for your suggestions. That looks like it will do the job.

P.S. Someone should optimize these forums for viewing on an XDA real soon now. ;)