Amaury Forgeot d'Arc <amaur...@gmail.com> added the comment: To test windows callbacks, I suggest to use EnumResourceTypes() instead, which is more likely to work in any condition:
def test(): from ctypes.wintypes import BOOL, HMODULE, LONG, LPARAM import ctypes EnumResourceTypes = ctypes.windll.kernel32.EnumResourceTypesA EnumResTypeProc = ctypes.WINFUNCTYPE( BOOL, HMODULE, LONG, LPARAM) resource_types = [] def callback(hModule, typeid, lParam): resource_types.append(typeid) return True # keep enumerating hModule = None # Main executable RT_MANIFEST = 24 # from winuser.h EnumResourceTypes(hModule, EnumResTypeProc(callback), None) assert RT_MANIFEST in resource_types ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9055> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com