# 需要导入模块: from ctypes import windll [as 别名]
# 或者: from ctypes.windll import user32 [as 别名]
def __init__(self):
"""Initialize our object"""
# Find the start x,y pos of the main pygame *screen* (the screen in the
# window):
sdlpos = os.getenv("SDL_VIDEO_WINDOW_POS")
if sdlpos is None:
raise Exception("Must have previously setup a Pygame window starting position via the 'SDL_VIDEO_WINDOW_POS' evn var.")
self.initPygameScreenPos = [int(i) for i in sdlpos.split(",")]
# Run our ctypes code to query window position:
try:
# It's said that not all systems support this dictionary key. I'm
# not sure what systmes those are, but might as well put a check in.
self.hwnd = pygame.display.get_wm_info()["window"]
except KeyError:
raise Exceptio