win_GUI.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Automation-Framework-for-devices 作者: tok-gogogo 项目源码 文件源码
def Mouse_RB(self,str_app,lb_dx,lb_dy,Flag='1'):
        print "*********Mouse_RB function**********"
        time.sleep(1)
        tmp=(string.atoi(lb_dx),string.atoi(lb_dy))
        hwnd = win32gui.FindWindow(None, str_app)
        print 'Mouse_RB str_app,hwnd ',str_app,hwnd
        if hwnd < 1:
            hwnd = self.find_main_window(str_app)
            #win32gui.ShowWindow(hwnd, 0)
        win32api.SetCursorPos(tmp)
        print 'Mouse_RB tmp =',tmp
        if Flag == '1':
            time.sleep(1)
            win32api.mouse_event(win32con.MOUSEEVENTF_RIGHTDOWN,tmp[0], tmp[1]) 
            time.sleep(0.05)
            win32api.mouse_event(win32con.MOUSEEVENTF_RIGHTUP,tmp[0], tmp[1])
            time.sleep(0.05)
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号