1 import sys 2 from ctypes import * 3 4 ##class HMODULE(Structure): 5 ## _fields_ = [("value", c_void_p)] 6 7 ## def __repr__(self): 8 ## return "<HMODULE %s>" % self.value 9 10 ##windll.kernel32.GetModuleHandleA.restype = HMODULE 11 12 ##print windll.kernel32.GetModuleHandleA("python23.dll") 13 ##print hex(sys.dllhandle) 14 15 ##def nonzero(handle): 16 ## return (GetLastError(), handle) 17 18 ##windll.kernel32.GetModuleHandleA.errcheck = nonzero 19 ##print windll.kernel32.GetModuleHandleA("spam") 20