This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Power up/down on ppc


Power up/down on ppc

Postby angedelamort » May 9, 2002 @ 7:49pm

User avatar
angedelamort
pm Member
 
Posts: 304
Joined: Mar 7, 2002 @ 11:16pm
Location: Montreal, Quebec


Postby Dan East » May 9, 2002 @ 8:53pm

Well, I don't know if Pocket PC 2002 added the capability or not. My understanding is that the only way to do it is to take control of the com port as a driver of some sort, which is then notified of power events. An excerpt from the topic "Programming in the Suspend State":
WaitCommEvent Waits for a communications event to occur. Serial, Infrared Data Association (IrDA), or PC Card storage devices can return EV_POWER when the device resumes operation.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Dan East » May 9, 2002 @ 8:55pm

Another indirect method is to create a timer (WM_TIMER) for say 5 seconds. Each time the event fires check how long since the last event occured. If it has been more than say 10 seconds (which allows for the system to grind to a halt as it does on occasion), you know the device was suspended.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby angedelamort » May 9, 2002 @ 9:02pm

Thanks,

the first one seem interesting, but i think you need to specify an absolute path, so if someone change the app to another location, it will crash or display an error msg I think.

I'm using the second method for now, with a timer of 2 seconds. It works fine, but if you play with power button, it will not work :(

Thanks M$ for this great API lol

and this time for real, thanks Dan!
User avatar
angedelamort
pm Member
 
Posts: 304
Joined: Mar 7, 2002 @ 11:16pm
Location: Montreal, Quebec


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron