pythonCE GetSystemPowerState windows api
theller at python.net
Sat Apr 25 18:19:36 CEST 2009
lorenzo.mentaschi at yahoo.it schrieb:
> Hi all,
> I need to call GetSystemPowerState windows api from pythonCE, because
> I need to know if a windows ce 5 device is in sleep/off status.
> I can find this api in ctypes.windll.coredll, but I cannot figure out
> how to pass parameters to this procedure: msdn giude (
> http://msdn.microsoft.com/en-us/library/ms899319.aspx ) speaks about 3
> parameters, of wich 2 are output: a "LPWSTR pBuffer" and a "PDWORD
> pFlags". Returned value of the call is an exit status code
> rappresenting if call succeded or failed.
> I tried to call this api in several ways, but obtained always exit
> code 87 (meaning that parameters are wrong) or 122 (meaning "pBuffer"
> variable is too small, in this case I passed None as pBuffer, since
> I'm interested only in pFlags result).
> Have you any idea? Maybe another api or way to perform this simple
Python 2.5 (release25-maint, Dec 19 2006, 23:22:00) [MSC v.1201 32 bit (ARM)] on win32
>>> from ctypes import *
<_FuncPtr object at 0x0016EC60>
More information about the Python-list