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.