【发布时间】:2012-11-09 01:29:15
【问题描述】:
我在使用 ctypes 将此 C# 代码转换为 python 时遇到问题。此代码用于隐藏 Windows 7 启动球。这是link。
[DllImport("user32.dll")]
private static extern IntPtr FindWindowEx(
IntPtr parentHwnd,
IntPtr childAfterHwnd,
IntPtr className,
string windowText);
IntPtr hwndOrb = FindWindowEx(IntPtr.Zero, IntPtr.Zero, (IntPtr)0xC017, null);
我必须定义
FindWindow = ctypes.windll.user32.FindWindowEx
FindWindow.restype = wintypes.HWND
FindWindow.argtypes = [
wintypes.HWND, ##hWnd
wintypes.HWND, ##hWnd
]
还是直接使用?抱歉,我是使用 python ctypes 的新手。
hWnd = win32gui.FindWindowEx (win32gui.GetDesktopWindow(),
None,0xC017 ,None)
【问题讨论】:
-
您是否考虑过使用
IronPython,它可以更方便地访问.NET 框架?