utils.py 文件源码

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

项目:autoops_for_win 作者: qiueer 项目源码 文件源码
def SetWinCenter(cls, whd):
        rect = WinUtil.GetCompRect(whd)
        left = (win32api.GetSystemMetrics(win32con.SM_CXFULLSCREEN)-(rect.right-rect.left))/2;  
        top = (win32api.GetSystemMetrics(win32con.SM_CYFULLSCREEN)-(rect.bottom-rect.top))/2;  
        #Move the window to the correct coordinates with SetWindowPos()  
        cls.SetAsForegroundWindow(whd)
        win32gui.SetWindowPos(whd, win32con.HWND_TOPMOST, left, top,-1,-1, win32con.SWP_NOSIZE | win32con.SWP_NOZORDER);  
        win32gui.SetWindowPos(whd, win32con.HWND_NOTOPMOST, 0, 0, 0, 0, win32con.SWP_NOSIZE | win32con.SWP_NOMOVE);
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号