[New release] VistaHide Battery Gauge 1.0

Search This thread

ins0mniaque

Member
Oct 30, 2006
10
0
Hello!

I recently purchased an iPaq hw6955 and fell in love with it. I have been coding on Windows for way too many years, yet this is the first time my PDA doesn't run Linux (or OpenBSD ;)).

I recently saw levenum's taskbar battery meter, and though that it would make a nice project for a first mobile application. How pleased I was when levenum accepted my request to share the sources. How even more pleased and surprised I was when I saw the code. It is exactly the same as coding on Windows...

So my idea was to have a fullscreen gradient bar that would look "behind" VistaBetaTWO's WA2 Aero skin. And I've done it (and it only weights 12 kb!).

Here is a screenshot for your viewing pleasure.

screenshot.png

But after having read levenum's thread, I understood some people would like it thinner, etc... So there are tons of options read from the registry! The gauge should work on WM 5.0 PocketPC and Smartphone editions, and should handle screen rotation, but I can't test this because the emulator doesn't have an option to switch between landscape and portrait, and the hw6955 is a square screen device.

The registry keys are kept for each resolution, which I will write as "W x H". (e.g. The base key for my device (240 x 240) would be HKCU\Software\VistaHide\Battery Gauge\240 x 240\). All of these keys are independant (i.e. If you need to only modify the height of the bar, you only need to create the Height key.)

Options :

[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\X
- Window's left position. Default : 0.

[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Y
- Window's top position. Default : 0.

[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Width
- Window's width. Default : -1.
- Note: Any value below 0 means fullscreen.

[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Height
- Window's height. Default : 4.

[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Thresholds\Critical
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Thresholds\Low
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Thresholds\High
- Value between 0 and 100 which represents the gradient thresholds.
- Default : (Critical) 0.05, (Low) 0.25, (High) 1.00.

[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Colors\Background\Light
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Colors\Background\Normal
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Colors\Background\Dark
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Colors\Critical\Light
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Colors\Critical\Normal
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Colors\Critical\Dark
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Colors\Low\Light
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Colors\Low\Normal
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Colors\Low\Dark
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Colors\High\Light
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Colors\High\Normal
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Colors\High\Dark
- Colors! If you look closely at the screenshot, you will see that the bar is "beleveled". The light color is the top part, and dark one the bottom, everything in between is normal. Want to disable "beleveling" ? Set the light, normal and dark to the same color.
- Default values ( Light, Normal, Dark ) :
Background : RGB ( 64, 64, 64 ), RGB ( 32, 32, 32 ), RGB ( 0, 0, 0 )
Critical : RGB ( 255, 127, 127 ), RGB ( 255, 0, 0 ), RGB ( 127, 0, 0 )
Low : RGB ( 255, 255, 127 ), RGB ( 255, 255, 0 ), RGB ( 127, 127, 0 )
High : RGB ( 127, 255, 127 ), RGB ( 0, 255, 0 ), RGB ( 0, 127, 0 )

[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Excluded Regions\{Anything}\X
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Excluded Regions\{Anything}\Y
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Excluded Regions\{Anything}\Width
[DWORD] HKCU\Software\VistaHide\Battery Gauge\W x H\Excluded Regions\{Anything}\Height
- Now for the fun part... This is how you can remove "parts" of the bar. For every key in "Excluded Regions", it will read a rectangle, and exclude it from the window.
- Default value : No excluded regions.


Example (I think it's necessary ;)) :

Here are the keys needed to achieve the look in the screenshot (at 240 x 240). It uses all the default values, except for 4 excluded regions (one per line).

HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 1\X : (DWORD) 13
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 1\Y : (DWORD) 0
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 1\Width : (DWORD) 11
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 1\Height : (DWORD) 1
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 2\X : (DWORD) 11
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 2\Y : (DWORD) 1
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 2\Width : (DWORD) 15
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 2\Height : (DWORD) 1
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 3\X : (DWORD) 10
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 3\Y : (DWORD) 2
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 3\Width : (DWORD) 17
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 3\Height : (DWORD) 1
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 4\X : (DWORD) 9
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 4\Y : (DWORD) 3
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 4\Width : (DWORD) 19
HKCU\Software\VistaHide\Battery Gauge\240 x 240\Excluded Regions\Line 4\Height : (DWORD) 1


EDIT: Forgot one neat feature... If you launch it while it is already running, it will close the running instance.

Hope you enjoy, and you can expect a lot more freebies like this from me in the future!
 
Last edited:

malatesta

Senior Member
May 15, 2006
204
0
NY
Awesome post. Thanks so much for this.

Great tutorial as well, I succesfully (and easily) adjusted my height to 2 which is a lot less intrusive for my needs. ;-)
 

ins0mniaque

Member
Oct 30, 2006
10
0
Glad you find it useful. For those who intend to use it on a device that can rotate the screen, I remembered while commuting home that I forgot to regenerate the bitmaps on rotation. This means that the bar will not be drawn correctly upon rotation. I will fix this in the next version.

And if I feel like it, I might even make another application to configure it (to keep the bar's small footprint.)
 

mugen_jon

Member
Mar 14, 2006
9
0
Awesome application... thanks u very much...
i have already download and try it... however why my bar always shown in front of my wisbar not behind the wisbar ?
Have i do anything wrong ??
 

ins0mniaque

Member
Oct 30, 2006
10
0
Awesome application... thanks u very much...
i have already download and try it... however why my bar always shown in front of my wisbar not behind the wisbar ?
Have i do anything wrong ??

The bar is not "behind" the wisbar. It is simply not drawn at some places. To achieve the same looks as in the screen shot, the you need the 16 registry values I posted in the section "Here are the keys needed to achieve the look in the screenshot (at 240 x 240). It uses all the default values, except for 4 excluded regions (one per line).".
 

ins0mniaque

Member
Oct 30, 2006
10
0
hi, i tried it on my T-Mobile SDA WM5 smartphone but nothing happened.

Sorry, my bad! I blatantly assumed the smartphone edition was like the PocketPC edition. I will fix this in the next version. Probably friday afternoon.

There was also no HKCU registry entries.

I might have been a little bit too implicit. HKCU stands for HKEY_CURRENT_USER. All those keys do not exist, and they are not created by the program. The bar will attempt to read those values on start, and will fall back to the default value if the key doesn't exist. For exemple, if you only create the "HKCU\Software\VistaHide\Battery Gauge\W x H\Height" key, then only the Height of the bar will be modified, nothing else.
 

oldsap

Senior Member
Apr 4, 2006
1,100
10
oldsap.blogspot.com
Sorry, my bad! I blatantly assumed the smartphone edition was like the PocketPC edition. I will fix this in the next version. Probably friday afternoon.
Thank you. will be eagerly waiting for it :)


I might have been a little bit too implicit. HKCU stands for HKEY_CURRENT_USER. All those keys do not exist, and they are not created by the program. The bar will attempt to read those values on start, and will fall back to the default value if the key doesn't exist. For exemple, if you only create the "HKCU\Software\VistaHide\Battery Gauge\W x H\Height" key, then only the Height of the bar will be modified, nothing else.
thanks for the clear up
 

trojan9x

Senior Member
Feb 28, 2006
323
13
anyone get it to automatically adjust when going from portrait to landscape?
 

vicn77

Member
Jun 18, 2007
28
1
I know this is an old post but I've been trying to get this off my mogul for a while now. Somehow it's gotten to my startup folder and I've tried everything to delete it.

Any suggestions?

Thanks.
 

hendrixus

Senior Member
Jan 25, 2006
1,334
6
Amsterdam
I know this is an old post but I've been trying to get this off my mogul for a while now. Somehow it's gotten to my startup folder and I've tried everything to delete it.

Any suggestions?

Thanks.


From the 1st post
"EDIT: Forgot one neat feature... If you launch it while it is already running, it will close the running instance."

Take care it isn't active. Then uninstall it!
 
Last edited:

vicn77

Member
Jun 18, 2007
28
1
tried that also, total commander says its unable to delete the file.

so i just had it inactive and moved it out of the startup folder.
 

doctordj11

New member
Nov 4, 2007
3
0
Does not reload on Power off

I am running WM6 on an AT&T Tilt. The program runs fine (and I find it extremely helpful...well done). For some reason, when I turn the phone off and restart it, the Battery Bar does not reload. I have to restart it every time. Any thoughts?

Thanks in advance, both for the help and for creating a wonderful little program.

DJ