是否可以从 Python 中调用ShutdownBlockReasonCreate
、ShutdownBlockReasonDestroy
和win32 API?ShutdownBlockReasonQuery
我在图书馆的任何地方都找不到它们pywin32
。
谢谢!
使用ctypes
from ctypes import *
retval = windll.user32.ShutdownBlockReasonCreate(
handle,
c_wchar_p("the reason")
)
if retval != 0:
... Error checking
Run Code Online (Sandbox Code Playgroud)
与 ShutdownBlockReasonDestroy 类似。