示例#1
0
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)})
示例#2
0
 def callback(hwnd, hwnds):
     if win32gui.IsWindow(hwnd) and win32gui.IsWindowVisible(
             hwnd) and win32gui.IsWindowEnabled(hwnd):
         if win32gui.GetWindowText(hwnd) == title:
             win32gui.SetForegroundWindow(hwnd)
             return
示例#3
0
def foo(hwnd, mouse):
    titles = globalvar.get_value('titles')
    if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(
            hwnd) and win32gui.IsWindowVisible(hwnd):
        titles.add(win32gui.GetWindowText(hwnd))
        globalvar.set_value('titles', titles)
示例#4
0
 def callback(hwnd, hwnds):
     if win32gui.IsWindowVisible(hwnd) and win32gui.IsWindowEnabled(hwnd):
         _, found_pid = win32process.GetWindowThreadProcessId(hwnd)
         if found_pid == pid:
             hwnds.append(hwnd)
     return True
示例#5
0
 def get_visible_hwnds(hwnd, mouse):
     if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(
             hwnd) and win32gui.IsWindowVisible(hwnd):
         titles.append(win32gui.GetWindowText(hwnd))
示例#6
0
def isRawWindow(hwnd):
    return not win32gui.IsWindowVisible(hwnd) or not win32gui.IsWindowEnabled(hwnd) or ctypes.windll.user32.IsHungAppWindow(hwnd)
def get_all_hwnd(hwnd, mouse):
    if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(
            hwnd) and win32gui.IsWindowVisible(hwnd):
        mainFormList.update({hwnd:
                             win32gui.GetWindowText(hwnd)})  # 更新mainFormList
示例#8
0
try:
    pro = subprocess.Popen('calc')
except Exception as msg:
    print(msg)

try:
    CSV = list(csv.reader(open('Sample.csv')))
except Exception as msg:
    pro.kill()
    print("Cannot open the CSV file or file not found!")

time.sleep(1)

WDHWD = win32gui.FindWindow(None, "Calculator")

if win32gui.IsWindowVisible(WDHWD) and win32gui.IsWindowEnabled(WDHWD):
    # Get all the sub-windows of the Calc
    win32gui.EnumChildWindows(WDHWD, add_controls, None)
    time.sleep(1)

    win32gui.SetForegroundWindow(WDHWD)

    time.sleep(1)

    if len(CSV) != 0:
        # Explore every row of the CSV file
        for row in range(len(CSV)):
            print("now counting row " + str(row))
            res = False  #Keep False until clicked '=' on the Calculator
            # Explore elements in a row of CSV file
            for element in CSV[row]:
示例#9
0
def callback(hwnd, hwnds):
    if win32gui.IsWindowVisible(hwnd) and win32gui.IsWindowEnabled(hwnd):
        hwnds = hwnds.append(hwnd)
示例#10
0
def foo(hwnd, mouse):
    if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(
            hwnd) and win32gui.IsWindowVisible(hwnd):
        titles.add(win32gui.GetWindowText(hwnd))
示例#11
0
文件: screen.py 项目: pytreasure/hid
def all_hwnd(hwnd, mouse):
    hwnd_windows = dict()
    if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(hwnd) and win32gui.IsWindowVisible(hwnd):
        hwnd_windows.update({hwnd: win32gui.GetWindowText(hwnd)})
    return hwnd_windows
示例#12
0
 def get_all_hwnd(hwnd, mouse):
     if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(hwnd) and win32gui.IsWindowVisible(hwnd):
         this_title = win32gui.GetWindowText(hwnd)
         if title == this_title:
             hwnds.append(hwnd)
示例#13
0
 def get_all_hwnd(hwnd, mouse):
     if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(hwnd) and win32gui.IsWindowVisible(hwnd):
         title = win32gui.GetWindowText(hwnd)
         if title:
             window.update({hwnd:title})
示例#14
0
def callback(hwnd, hwnds):
    if win32gui.IsWindowVisible(hwnd) and win32gui.IsWindowEnabled(hwnd):
        hwnds[win32gui.GetClassName(hwnd)] = hwnd
    return True
示例#15
0
 def callback(hwnd, hwnd_list: list):
     title = win32gui.GetWindowText(hwnd)
     if win32gui.IsWindowEnabled(hwnd) and win32gui.IsWindowVisible(hwnd) and title:
         hwnd_list.append((title, hwnd))
     return True