Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting battery events in WinCE

5 views
Skip to first unread message

Alon

unread,
Dec 21, 2009, 10:25:01 PM12/21/09
to
Hi,

I think I know how to get the battery status using pinvoke
GetSystemPowerStatusEx2.

My question is how can I get a notification about a change in the status
(like in WM - microsoft.windowsmobile.status.dll).

thanks,

Alon


Luca Calligaris [eMVP]

unread,
Dec 22, 2009, 2:54:20 AM12/22/09
to

In native code you can use RequestPowerNotification
(http://msdn.microsoft.com/en-us/library/ms919833.aspx) with
PBT_POWERINFOCHANGE flag than, using a message queue you'll be notified
about the change

--
Luca Calligaris (MVP-Windows Embedded)
l.calliga...@eurotech.it.nospam
www.eurotech.it


"Alon" <Al...@discussions.microsoft.com> ha scritto nel messaggio
news:08A032D5-6470-4CEA...@microsoft.com...

Alon

unread,
Dec 22, 2009, 1:00:01 PM12/22/09
to
thanks Luca.

A question, in the PND I'm working on, everytime I'm restarting it, all
changes in the windoes drive are being reset. Won't it reset any MSMQ I will
set? Is there another solution for notifications?

Thanks,

Alon

Bruce Eitman [eMVP]

unread,
Dec 22, 2009, 3:32:36 PM12/22/09
to
Of course any pending messages will be lost, but you don't need them. You
will start again and start with the current battery status.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

Eurotech Inc.
www.Eurotech.com

"Alon" <Al...@discussions.microsoft.com> wrote in message
news:30CE4148-AFFD-43AF...@microsoft.com...

Alon

unread,
Dec 22, 2009, 8:23:01 PM12/22/09
to
Yes, but I wanted to save the creation of new MSMQ every time (or actually
should I use an existing one?).

But, I also agree that it is A solution...


Alon

Bruce Eitman [eMVP]

unread,
Dec 22, 2009, 11:13:34 PM12/22/09
to
Huh? Save the creation of new MSMQ evcery time, what does that mean? You
just rebooted, do you think that the message queue is still running? It
isn't.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

Eurotech Inc.
www.Eurotech.com

"Alon" <Al...@discussions.microsoft.com> wrote in message

news:6B35BDAB-A92B-4FDC...@microsoft.com...

Alon

unread,
Dec 23, 2009, 12:06:01 AM12/23/09
to
No, I'm sure it isn't. All is clear, I think we can close this thread. Thanks
to all :)
0 new messages