我在使用ctypes将C代码转换为python时遇到问题。此代码用于隐藏Windows7启动orb。这是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);
我需要定义吗
^{pr2}$还是直接用?抱歉,我刚开始使用python ctypes。在
hWnd = win32gui.FindWindowEx (win32gui.GetDesktopWindow(),
None,0xC017 ,None)
如果有你看到的错误信息会很有帮助。但是,这几乎是肯定的,因为您需要使用},如果您真的想要ASCII、非Unicode版本),而不是直接使用findwowex。您还需要为所有四个参数指定argtypes。在
user32.FindWindowExW
(或者{这是来自docs的原型:
那这个呢?在
^{pr2}$您也可以根据链接到的C代码执行FindWindow(而不是FindWindowEx):
相关问题 更多 >
编程相关推荐