- 791 名前:デフォルトの名無しさん mailto:sage [2008/12/26(金) 15:09:33 ]
- ttp://www.python.jp/doc/release/lib/ctypes-callback-functions.html
from ctypes import * from ctypes.wintypes import * EnumWindows = windll.user32.EnumWindows EnumWindows.argtypes = [c_void_p, c_int] EnumWindows.restypes = c_int EnumWindowsCallback = CFUNCTYPE(c_int, c_int, c_int) GetWindowText = windll.user32.GetWindowTextA GetWindowText.argtypes = [c_int, c_char_p, c_int] GetWindowText.restypes = c_int def pyEnumWindowsCallback(hwnd, lp): buf = create_string_buffer('\000' * 1024) GetWindowText(hwnd, buf, 1024) if len(buf) > 0: if buf.value != '': print buf.value return True EnumWindows(EnumWindowsCallback(pyEnumWindowsCallback), 0)
|

|