def main(): hwndList = dolScript.getDolHwndList() #pyqmacro.dllHelp('BGKM5.dll') print hwndList hwnd = hwndList[0] proc = WindowHelper.getProcByHwnd( hwnd) print dolScript.getRoleName(proc) mxy = dolScript.getMousePos(hwnd, 0, 0) #pyqmacro.invoke('BGKM5.dll','LClick',[hwnd, mxy[0], mxy[1]]) #ret = dll.Mouse("LClick", hwnd, 627, 495) #ret = dll.Key("KeyClick", hwnd, win32con.VK_RETURN) ret = dll.Mouse('LClick', hwnd, 547, 240) print ret print win32gui.SetActiveWindow(hwnd) print win32api.GetLastError() #print windll.user32.PostMessageA(hwnd, win32con.WM_KEYDOWN, 9,0x1) #time.sleep(0.01) #print windll.user32.PostMessageA(hwnd, win32con.WM_CHAR, 13,0) #print windll.user32.PostMessageA(hwnd, win32con.WM_KEYUP, 9,0xC0000001) #print windll.user32.PostMessageA(hwnd, win32con.WM_KEYDOWN, 13,0x1C0001) time.sleep(0.01) #print windll.user32.PostMessageA(hwnd, win32con.WM_CHAR, 13,0x1) time.sleep(0.01)
def getDolList(): '''获取机器内所有大航海OL的信息 return (name, hwnd, id) ''' nameList = [] winHelper = helper.WindowHelper() hwndList = dolScript.getDolHwndList() for hwnd in hwndList: proc = WindowHelper.getProcByHwnd(hwnd) name = dolScript.getRoleName(proc) id = dolScript.getPCID(proc) threadID, processID = win32process.GetWindowThreadProcessId(hwnd) pidstr = "%d / %xh" % (processID, processID) win32gui.SetWindowText(hwnd, name + ' ' + pidstr) nameList.append((name, hwnd, id)) return nameList