我似乎无法让这段代码工作,我的印象是我做对了。
from ctypes import *
kernel32 = windll.kernel32
string1 = "test"
string2 = "test2"
kernel32.MessageBox(None,
string1,
string2,
MB_OK)
** 我尝试按照下面的建议将其更改为 MessageBoxA ** ** 我得到错误 :: **
Traceback (most recent call last):
File "C:\<string>", line 6, in <module>
File "C:\Python26\Lib\ctypes\__init__.py", line 366, in __getattr__
func = self.__getitem__(name)
File "C:\Python26\Lib\ctypes\__init__.py", line 371, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'MessageBoxA' not found