Hpw to put Battery Icon In Nav Bar WM2003SE

R

RDub

I would like to place an Icon on the Nav Bar (at the top of the screen)
showing the battery charge state. I already have all of the code needed to
get the battery information. I just need to place a representative icon in
the Nav Bar. I have Googled the subject and have not found any information
on how this might be done in a managed application. I did find one
reference at http://www.pocketpcdn.com/articles/taskbar_icon.html which
shows some C++ code that I am unable to understand.

Rdub
 
S

Simon Hart [MVP]

This is usally used for notifications (bubble) which is the
Microsoft.WindowsCE.Forms.Notification class in CF 2.0 and onwards.

Sounds like you want the notify icon functionality which can be achieved by
P/invoking Shell_NotifyIcon in coredll.dll: declaration is as follows:

[DllImport("coredll.dll", SetLastError = true)]
public static extern int Shell_NotifyIcon(
int dwMessage, ref NOTIFYICONDATA pnid);
 
R

RDub

Simon thanks for the heads up.

I have done some googling and have found good information and sample code
using Shell_NotifyIcon. Looks like this code adds, modifies, or removes an
icon on the system tray at the bottom of the Today screen.

I want to get an Icon in the Nav bar at the top of the screen. I don't even
need to handle user click events.

Rdub
Simon Hart said:
This is usally used for notifications (bubble) which is the
Microsoft.WindowsCE.Forms.Notification class in CF 2.0 and onwards.

Sounds like you want the notify icon functionality which can be achieved
by
P/invoking Shell_NotifyIcon in coredll.dll: declaration is as follows:

[DllImport("coredll.dll", SetLastError = true)]
public static extern int Shell_NotifyIcon(
int dwMessage, ref NOTIFYICONDATA pnid);
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


RDub said:
I would like to place an Icon on the Nav Bar (at the top of the screen)
showing the battery charge state. I already have all of the code needed
to
get the battery information. I just need to place a representative icon
in
the Nav Bar. I have Googled the subject and have not found any
information
on how this might be done in a managed application. I did find one
reference at http://www.pocketpcdn.com/articles/taskbar_icon.html which
shows some C++ code that I am unable to understand.

Rdub
 
S

Simon Hart [MVP]

For what purpose? The notification class is used for this, but it is usally
used to relay messages to the end user.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


RDub said:
Simon thanks for the heads up.

I have done some googling and have found good information and sample code
using Shell_NotifyIcon. Looks like this code adds, modifies, or removes an
icon on the system tray at the bottom of the Today screen.

I want to get an Icon in the Nav bar at the top of the screen. I don't even
need to handle user click events.

Rdub
Simon Hart said:
This is usally used for notifications (bubble) which is the
Microsoft.WindowsCE.Forms.Notification class in CF 2.0 and onwards.

Sounds like you want the notify icon functionality which can be achieved
by
P/invoking Shell_NotifyIcon in coredll.dll: declaration is as follows:

[DllImport("coredll.dll", SetLastError = true)]
public static extern int Shell_NotifyIcon(
int dwMessage, ref NOTIFYICONDATA pnid);
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


RDub said:
I would like to place an Icon on the Nav Bar (at the top of the screen)
showing the battery charge state. I already have all of the code needed
to
get the battery information. I just need to place a representative icon
in
the Nav Bar. I have Googled the subject and have not found any
information
on how this might be done in a managed application. I did find one
reference at http://www.pocketpcdn.com/articles/taskbar_icon.html which
shows some C++ code that I am unable to understand.

Rdub
 
R

RDub

We have an Application that takes over the device and runs as a Kiosk app.
The user never sees the Today Screen. Right now in order to see the battery
state they need to nagivate to another page. The Nav bar is always visible
in our app. It'd be way cool if I could put a itybity battery with some
itybity bars right smack dab in the center of the Nav bar.

Rdub
Simon Hart said:
For what purpose? The notification class is used for this, but it is
usally
used to relay messages to the end user.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


RDub said:
Simon thanks for the heads up.

I have done some googling and have found good information and sample code
using Shell_NotifyIcon. Looks like this code adds, modifies, or removes
an
icon on the system tray at the bottom of the Today screen.

I want to get an Icon in the Nav bar at the top of the screen. I don't
even
need to handle user click events.

Rdub
Simon Hart said:
This is usally used for notifications (bubble) which is the
Microsoft.WindowsCE.Forms.Notification class in CF 2.0 and onwards.

Sounds like you want the notify icon functionality which can be
achieved
by
P/invoking Shell_NotifyIcon in coredll.dll: declaration is as follows:

[DllImport("coredll.dll", SetLastError = true)]
public static extern int Shell_NotifyIcon(
int dwMessage, ref NOTIFYICONDATA pnid);
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


:

I would like to place an Icon on the Nav Bar (at the top of the
screen)
showing the battery charge state. I already have all of the code
needed
to
get the battery information. I just need to place a representative
icon
in
the Nav Bar. I have Googled the subject and have not found any
information
on how this might be done in a managed application. I did find one
reference at http://www.pocketpcdn.com/articles/taskbar_icon.html
which
shows some C++ code that I am unable to understand.

Rdub
 
R

RDub

I don't know if anyone else out there is interested in doing this, but I
thought I'd post my solution. Basically I bagged the idea of coding this
myself when I discovered that there were a few freeware utilities that would
do what I needed. I found and try'd four of em' (BatMon2K2, BattNav, Smenu,
and pBar) and finally settled on BatMon2K2.

Smenu was by far and away the most polished app of all, but it was a real
pain to make persistent across cold boots. Even though I finally got it all
working, in the end was to full featured for my needs.

Rdub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top