标签:tle color enable rgba update copy code 前置 else
import time, threading, copy import win32api, win32con import win32gui import win32gui def zhaojb(aa): mu=0 jh=[] hwnd_title = dict() def get_all_hwnd(hwnd,mouse): if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(hwnd) and win32gui.IsWindowVisible(hwnd): hwnd_title.update({hwnd:win32gui.GetWindowText(hwnd)}) win32gui.EnumWindows(get_all_hwnd, 0) for h,t in hwnd_title.items(): if t is not "": if aa in t: jh.append(h) if len(jh)==0: print("找不到相应的句柄") else: return jh ab=zhaojb("SM") jbid=ab[0]#有可能找到多个 print(jbid) win32gui.SetForegroundWindow(jbid)#将相应的窗口前置为活动窗口
标签:tle color enable rgba update copy code 前置 else
原文地址:https://www.cnblogs.com/xkdn/p/14073396.html