PC Review


Reply
Thread Tools Rate Thread

How to turn OFF a pocket pc device?

 
 
=?Utf-8?B?anV2aQ==?=
Guest
Posts: n/a
 
      7th Aug 2005
Hi, How can I turn off a pocket pc device with visual c#.net? I only found a
solution for embedded visual c++...please help me. Thank you

juvi
 
Reply With Quote
 
 
 
 
Sergey Bogdanov
Guest
Posts: n/a
 
      7th Aug 2005
Try this:


using System.Runtime.InteropServices;
....

[DllImport("coredll.dll")]
private static extern void PowerOffSystem();


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


juvi wrote:
> Hi, How can I turn off a pocket pc device with visual c#.net? I only found a
> solution for embedded visual c++...please help me. Thank you
>
> juvi

 
Reply With Quote
 
 
 
 
=?Utf-8?B?anV2aQ==?=
Guest
Posts: n/a
 
      7th Aug 2005
Hi,

it works, but is it a save way to power off? I tested it on a HP iPAQ
HX4700. If I power off the device with this code, then you can see the
display getting darker and darker. If you you use e.g.: Battery Pack Pro to
power off, then the display is powered off immediately. What do you think
about this?

juvi

"Sergey Bogdanov" wrote:

> Try this:
>
>
> using System.Runtime.InteropServices;
> ....
>
> [DllImport("coredll.dll")]
> private static extern void PowerOffSystem();
>
>
> --
> Sergey Bogdanov [.NET CF MVP, MCSD]
> http://www.sergeybogdanov.com
>
>
> juvi wrote:
> > Hi, How can I turn off a pocket pc device with visual c#.net? I only found a
> > solution for embedded visual c++...please help me. Thank you
> >
> > juvi

>

 
Reply With Quote
 
Sergey Bogdanov
Guest
Posts: n/a
 
      7th Aug 2005
Well, you may try to turn it off by sending VK_OFF key. After that a
device will be turned off immediately:


keybd_event(VK_OFF, 0, 0, 0);
keybd_event(VK_OFF, 0, KEYEVENTF_KEYUP, 0);


....

const int KEYEVENTF_KEYUP = 2;
const int VK_OFF = 0xDF;

[DllImport("coredll.dll")]
private static extern void keybd_event(byte bVk, byte bScan, int
dwFlags, int dwExtraInfo);



--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


juvi wrote:
> Hi,
>
> it works, but is it a save way to power off? I tested it on a HP iPAQ
> HX4700. If I power off the device with this code, then you can see the
> display getting darker and darker. If you you use e.g.: Battery Pack Pro to
> power off, then the display is powered off immediately. What do you think
> about this?
>
> juvi
>
> "Sergey Bogdanov" wrote:
>
>
>>Try this:
>>
>>
>>using System.Runtime.InteropServices;
>>....
>>
>>[DllImport("coredll.dll")]
>>private static extern void PowerOffSystem();
>>
>>
>>--
>>Sergey Bogdanov [.NET CF MVP, MCSD]
>>http://www.sergeybogdanov.com
>>
>>
>>juvi wrote:
>>
>>>Hi, How can I turn off a pocket pc device with visual c#.net? I only found a
>>>solution for embedded visual c++...please help me. Thank you
>>>
>>>juvi

>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Turn Off Computer" fails to turn off power _dv Windows XP General 2 1st Jun 2006 01:53 PM
Windows XP Firewall wont turn off. How can i turn it off ??? Son Of Sheep. Windows XP Help 1 18th Jul 2005 09:21 PM
How can I turn off shading AND turn off the grid lines in a sende. =?Utf-8?B?UGVn?= Microsoft Outlook Discussion 0 9th Dec 2004 08:18 PM
To Turn Off or Not to Turn Off Natasha Windows XP Basics 12 12th Jun 2004 11:01 PM
XP says 'Turn off Color 1' instead of 'Turn off Computer' aybs Windows XP Setup 0 26th Jul 2003 03:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:03 AM.