Пример #1
0
#coding=utf-8
import S
gsTitle = '- Yandex Browser'
giClickY = 34
from qgb import py, Win, U, T, N, F
# U=py.importU()
from pywinauto import Application
app = Application()
pids = [i[0] for i in Win.getAllWindows() if i[1].endswith(gsTitle)]
ws = []
for i in pids:
    i = app.Connect(handle=i)
    i = i.windows()
    for w in i:
        if w.WindowText().endswith(gsTitle):
            if w not in ws: ws.append(w)
# F.dill_dump(obj=ws,file='browserGo_ws')
U.pprint(U.il(ws))
if U.ct(ws) == 0: Win.setCurPos(giClickY, giClickY)


def istop():
    x, y = Win.getCurPos()
    if y > giClickY * 6 or y > ih - 9:
        U.pln(iw, ih, i, 'Cur:', x, y)
        U.exit()


def click(w, x, y=giClickY):
    istop()
    try:
Пример #2
0
    0x0000ff: 'red',
    0x00ff00: 'green',
    0x00ffff: 'yellow',
    0xff0000: 'blue',  # blue color (RGB = 0x0000FF).
    0xff00ff:
    'pink',  #应该是 Magenta 洋红 On computer screens, it is made by mixing equal amounts of blue and red
    0xffff00: 'cyan',  #Cyan is a greenish-blue color. 青色
    0xffffff: 'white',
}
glc = list(gColour.keys())

hs = [i[0] for i in Win.getAllWindows() if gsTitle in i[1]]

if len(hs) != 1: raise EnvironmentError('sould only one npp', hs)

app = app.Connect(handle=hs[0])
ws = app.windows()
for i in ws:
    txt = i.window_text()
    if gsTitle in txt: wm = i
    #'剪贴板历史记录'
    if u'\u526a\u8d34\u677f\u5386\u53f2\u8bb0\u5f55' == txt:
        wc = i
        break
    if u'Clipboard History' in txt:
        wc = i
es = wc.element_info.children()

for i in es:
    if i.class_name == u'ListBox':
        elb = i