Does anybody know the API to turn off PPC device?

Thanks in advance.

John

Re: Want the API to turn off PPC device by The

The
Mon Nov 10 21:11:54 CST 2003


"JohnL" <hiliuzhe@hotmail.com> wrote in message
news:%23cl3zF%23pDHA.2216@TK2MSFTNGP12.phx.gbl...
> Does anybody know the API to turn off PPC device?

it's in the MSFT documentation.

of course the "Sleep(60)" part is a dubious hack, it may or may not work
depending on how long it takes for the device to turn off...

======================================
Suspending the Device
Applications can cause the device to suspend by simulating a press of the
Power key, which makes two calls to the keybd_event function, as shown in
the following code:

keybd_event(VK_OFF,0,KEYEVENTF_SILENT,0);
keybd_event(VK_OFF,0,KEYEVENTF_SILENT | KEYEVENTF_KEYUP,0);
sleep(60);The sleep statement allows time for the system to suspend and
prevents your application from executing further after you have called for
the suspend to occur.





Re: Want the API to turn off PPC device by JohnL

JohnL
Tue Nov 11 15:37:32 CST 2003

Great and thanks. It solves my problem.

John


"The PocketTV Team" <do-not-reply-by-email@pockettv.com> wrote in message
news:u%23GAQGAqDHA.964@TK2MSFTNGP10.phx.gbl...
>
> "JohnL" <hiliuzhe@hotmail.com> wrote in message
> news:%23cl3zF%23pDHA.2216@TK2MSFTNGP12.phx.gbl...
> > Does anybody know the API to turn off PPC device?
>
> it's in the MSFT documentation.
>
> of course the "Sleep(60)" part is a dubious hack, it may or may not work
> depending on how long it takes for the device to turn off...
>
> ======================================
> Suspending the Device
> Applications can cause the device to suspend by simulating a press of the
> Power key, which makes two calls to the keybd_event function, as shown in
> the following code:
>
> keybd_event(VK_OFF,0,KEYEVENTF_SILENT,0);
> keybd_event(VK_OFF,0,KEYEVENTF_SILENT | KEYEVENTF_KEYUP,0);
> sleep(60);The sleep statement allows time for the system to suspend and
> prevents your application from executing further after you have called for
> the suspend to occur.
>
>
>
>



Want the API to turn off PPC device by raajen

raajen
Tue Nov 11 15:52:18 CST 2003

The following will suspend (OFF) the device.
SetSystemPowerState(NULL,POWER_STATE_SUSPEND,POWER_FORCE);

>-----Original Message-----
>Does anybody know the API to turn off PPC device?
>
>Thanks in advance.
>
>John
>
>
>.
>