Python 与 ShutdownBlockReasonCreate、ShutdownBlockReasonDestroy 和 ShutdownBlockReasonQuery
在Python里面可以调用ShutdownBlockReasonCreate
、ShutdownBlockReasonDestroy
和ShutdownBlockReasonQuery
这些Win32的API吗?我在pywin32
库里找不到它们。
谢谢!
2 个回答
0
你可以试着在pywin32的邮件列表上提问或者请求一些功能的增强:
如果你等不及,而且找不到COM对象的话,可以考虑使用ctypes。用它几乎可以做任何事情。
5
使用ctypes
from ctypes import *
retval = windll.user32.ShutdownBlockReasonCreate(
handle,
c_wchar_p("the reason")
)
if retval != 0:
... Error checking
同样的方式也适用于ShutdownBlockReasonDestroy。