当前位置: 首页>>代码示例>>Python>>正文


Python win32gui.MoveWindow方法代码示例

本文整理汇总了Python中win32gui.MoveWindow方法的典型用法代码示例。如果您正苦于以下问题:Python win32gui.MoveWindow方法的具体用法?Python win32gui.MoveWindow怎么用?Python win32gui.MoveWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在win32gui的用法示例。


在下文中一共展示了win32gui.MoveWindow方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _DoSize

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def _DoSize(self, cx, cy, repaint=1):
        # right-justify the textbox.
        # ctrl = win32gui.GetDlgItem(self.hwnd, IDC_JOB_NAME)
        # win32gui.SetWindowText(ctrl, self.job_name)
        # l, t, r, b = win32gui.GetWindowRect(ctrl)
        # l, t = win32gui.ScreenToClient(self.hwnd, (l, t))
        # r, b = win32gui.ScreenToClient(self.hwnd, (r, b))
        # win32gui.MoveWindow(ctrl, l, t, cx-l-5, b-t, repaint)

        ctrl = win32gui.GetDlgItem(self.hwnd, IDC_SCRIPT)
        win32gui.SetFocus(ctrl)

        # The button.
        ctrl = win32gui.GetDlgItem(self.hwnd, IDC_BUTTON_SUBMIT)
        l, t, r, b = win32gui.GetWindowRect(ctrl)
        l, t = win32gui.ScreenToClient(self.hwnd, (l, t))
        r, b = win32gui.ScreenToClient(self.hwnd, (r, b))
        w = r - l
        win32gui.MoveWindow(ctrl, cx - 5 - w, t, w, b - t, repaint) 
开发者ID:eavatar,项目名称:eavatar-me,代码行数:21,代码来源:console.py

示例2: _DoSize

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def _DoSize(self, cx, cy, repaint = 1):
        # right-justify the textbox.
        ctrl = win32gui.GetDlgItem(self.hwnd, IDC_SEARCHTEXT)
        l, t, r, b = win32gui.GetWindowRect(ctrl)
        l, t = win32gui.ScreenToClient(self.hwnd, (l,t) )
        r, b = win32gui.ScreenToClient(self.hwnd, (r,b) )
        win32gui.MoveWindow(ctrl, l, t, cx-l-5, b-t, repaint)
        # The button.
        ctrl = win32gui.GetDlgItem(self.hwnd, IDC_BUTTON_DISPLAY)
        l, t, r, b = win32gui.GetWindowRect(ctrl)
        l, t = win32gui.ScreenToClient(self.hwnd, (l,t) )
        r, b = win32gui.ScreenToClient(self.hwnd, (r,b) )
        list_y = b + 10
        w = r - l
        win32gui.MoveWindow(ctrl, cx - 5 - w, t, w, b-t, repaint)

        # The list control
        win32gui.MoveWindow(self.hwndList, 0, list_y, cx, cy-list_y, repaint)
        # The last column of the list control.
        new_width = cx - win32gui.SendMessage(self.hwndList, commctrl.LVM_GETCOLUMNWIDTH, 0)
        win32gui.SendMessage(self.hwndList, commctrl.LVM_SETCOLUMNWIDTH, 1, new_width) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:23,代码来源:win32gui_dialog.py

示例3: _DoSize

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def _DoSize(self, cx, cy, repaint=1):
        # right-justify the textbox.
        # ctrl = win32gui.GetDlgItem(self.hwnd, IDC_JOB_NAME)
        # win32gui.SetWindowText(ctrl, self.job_name)
        # l, t, r, b = win32gui.GetWindowRect(ctrl)
        # l, t = win32gui.ScreenToClient(self.hwnd, (l, t))
        # r, b = win32gui.ScreenToClient(self.hwnd, (r, b))
        # win32gui.MoveWindow(ctrl, l, t, cx-l-5, b-t, repaint)

        ctrl = win32gui.GetDlgItem(self.hwnd, IDC_SCRIPT)
        win32gui.SetFocus(ctrl)

        # The button.
        ctrl = win32gui.GetDlgItem(self.hwnd, IDC_BUTTON_SUBMIT)
        l, t, r, b = win32gui.GetWindowRect(ctrl)
        l, t = win32gui.ScreenToClient(self.hwnd, (l, t))
        r, b = win32gui.ScreenToClient(self.hwnd, (r, b))
        w = r - l
        win32gui.MoveWindow(ctrl, cx - 5 - w, t, w, b-t, repaint) 
开发者ID:eavatar,项目名称:eavatar-me,代码行数:21,代码来源:notice_dlg.py

示例4: shake

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def shake() -> None:
        """Shake that Window"""
        for x in range(1000):
            win32gui.MoveWindow(Window.id, x, 0, 1000, 800, False)
        for y in range(1000):
            win32gui.MoveWindow(Window.id, 1000, y, 1000, 800, False)
        for x in reversed(range(1000)):
            win32gui.MoveWindow(Window.id, x, 1000, 1000, 800, False)
        for y in reversed(range(1000)):
            win32gui.MoveWindow(Window.id, 0, y, 1000, 800, False) 
开发者ID:kujan,项目名称:NGU-scripts,代码行数:12,代码来源:window.py

示例5: OnSize

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def OnSize(self, hwnd, msg, wparam, lparam):
        #print "OnSize", self.hwnd_child, win32api.LOWORD(lparam), win32api.HIWORD(lparam)
        if self.hwnd_child is not None:
            x = win32api.LOWORD(lparam)
            y = win32api.HIWORD(lparam)
            win32gui.MoveWindow(self.hwnd_child, 0, 0, x, y, False)

# This uses scintilla to display a filename, and optionally jump to a line
# number. 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:11,代码来源:shell_view.py

示例6: OnInitDialog

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def OnInitDialog(self, hwnd, msg, wparam, lparam):
        self.hwnd = hwnd
        # centre the dialog
        desktop = win32gui.GetDesktopWindow()
        l,t,r,b = win32gui.GetWindowRect(self.hwnd)
        dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop)
        centre_x, centre_y = win32gui.ClientToScreen( desktop, ( (dt_r-dt_l)//2, (dt_b-dt_t)//2) )
        win32gui.MoveWindow(hwnd, centre_x-(r//2), centre_y-(b//2), r-l, b-t, 0)
        self._SetupList()
        l,t,r,b = win32gui.GetClientRect(self.hwnd)
        self._DoSize(r-l,b-t, 1) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:13,代码来源:win32gui_dialog.py

示例7: set_position

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def set_position(self, rectangle):
        assert isinstance(rectangle, Rectangle)
        l, t, w, h = rectangle.ltwh
        win32gui.MoveWindow(self._handle, l, t, w, h, 1)

    #-----------------------------------------------------------------------
    # Methods for miscellaneous window control. 
开发者ID:dictation-toolbox,项目名称:dragonfly,代码行数:9,代码来源:win32_window.py

示例8: set_position

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def set_position(self, rectangle):
        assert isinstance(rectangle, Rectangle)
        l, t, w, h = rectangle.ltwh
        win32gui.MoveWindow(self._handle, l, t, w, h, 1) 
开发者ID:t4ngo,项目名称:dragonfly,代码行数:6,代码来源:window.py

示例9: on_window1_size_request

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def on_window1_size_request(self, widget, data=None):
        if self.hWnd != 0:
            console_area = self.builder.get_object("frameconsole")
            console_area.realize()
            console_alloc = console_area.get_allocation()
            window_alloc = self.window.get_position()
            x = console_alloc.x + window_alloc[0] + 10
            y = console_alloc.y + window_alloc[1] + 47
            win32gui.MoveWindow(self.hWnd, x, y, console_alloc.width-10, console_alloc.height-5, 1) 
开发者ID:OpenXenManager,项目名称:openxenmanager,代码行数:11,代码来源:window.py

示例10: OnInitDialog

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def OnInitDialog(self, hwnd, msg, wparam, lparam):
        self.hwnd = hwnd
        # centre the dialog
        desktop = win32gui.GetDesktopWindow()
        l, t, r, b = win32gui.GetWindowRect(self.hwnd)
        dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop)
        centre_x, centre_y = win32gui.ClientToScreen(desktop, (
            (dt_r - dt_l) // 2, (dt_b - dt_t) // 2))
        win32gui.MoveWindow(hwnd, centre_x - (r // 2), centre_y - (b // 2),
                            r - l, b - t, 0)
        # self._SetupList()
        l, t, r, b = win32gui.GetClientRect(self.hwnd)
        self._DoSize(r - l, b - t, 1) 
开发者ID:eavatar,项目名称:eavatar-me,代码行数:15,代码来源:console.py

示例11: OnInitDialog

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def OnInitDialog(self, hwnd, msg, wparam, lparam):
        self.hwnd = hwnd
        # centre the dialog
        desktop = win32gui.GetDesktopWindow()
        l, t, r, b = win32gui.GetWindowRect(self.hwnd)
        dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop)
        centre_x, centre_y = win32gui.ClientToScreen(desktop,
                                                     ((dt_r - dt_l)//2,
                                                      (dt_b - dt_t)//2))
        win32gui.MoveWindow(hwnd, centre_x-(r//2),
                            centre_y-(b//2), r-l, b-t, 0)
        # self._SetupList()
        l, t, r, b = win32gui.GetClientRect(self.hwnd)
        self._DoSize(r-l, b-t, 1) 
开发者ID:eavatar,项目名称:eavatar-me,代码行数:16,代码来源:notice_dlg.py

示例12: OnInitDialog

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def OnInitDialog(self, hwnd, msg, wparam, lparam):
        self.hwnd = hwnd
        # centre the dialog
        desktop = win32gui.GetDesktopWindow()
        l, t, r, b = win32gui.GetWindowRect(self.hwnd)
        dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop)
        centre_x, centre_y = win32gui.ClientToScreen(
            desktop,
            ((dt_r-dt_l)//2, (dt_b-dt_t)//2))
        win32gui.MoveWindow(hwnd, centre_x-(r//2),
                            centre_y-(b//2), r-l, b-t, 0)
        # self._SetupList()
        l, t, r, b = win32gui.GetClientRect(self.hwnd)
        self._DoSize(r-l, b-t, 1) 
开发者ID:eavatar,项目名称:eavatar-me,代码行数:16,代码来源:simpledialog.py

示例13: set_size

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def set_size( self, rect ):
            win32gui.MoveWindow( self.handle,
                                 rect[ 0 ],
                                 rect[ 1 ],
                                 rect[ 2 ] - rect[ 0 ],
                                 rect[ 3 ] - rect[ 1 ],
                                 True ) 
开发者ID:mailpile,项目名称:gui-o-matic,代码行数:9,代码来源:winapi.py

示例14: _CreateChildWindow

# 需要导入模块: import win32gui [as 别名]
# 或者: from win32gui import MoveWindow [as 别名]
def _CreateChildWindow(self, prev):
        # Creates the list view window.
        assert self.hwnd_child is None, "already have a window"
        assert self.cur_foldersettings is not None, "no settings"
        style = win32con.WS_CHILD | win32con.WS_VISIBLE | win32con.WS_BORDER | \
                commctrl.LVS_SHAREIMAGELISTS | commctrl.LVS_EDITLABELS

        view_mode, view_flags = self.cur_foldersettings
        if view_mode==shellcon.FVM_ICON:
            style |= commctrl.LVS_ICON | commctrl.LVS_AUTOARRANGE
        elif view_mode==shellcon.FVM_SMALLICON:
            style |= commctrl.LVS_SMALLICON | commctrl.LVS_AUTOARRANGE
        elif view_mode==shellcon.FVM_LIST:
            style |= commctrl.LVS_LIST | commctrl.LVS_AUTOARRANGE
        elif view_mode==shellcon.FVM_DETAILS:
            style |= commctrl.LVS_REPORT | commctrl.LVS_AUTOARRANGE
        else:
            # XP 'thumbnails' etc
            view_mode = shellcon.FVM_DETAILS
            # Default to 'report'
            style |= commctrl.LVS_REPORT | commctrl.LVS_AUTOARRANGE

        for f_flag, l_flag in [
            (shellcon.FWF_SINGLESEL,        commctrl.LVS_SINGLESEL),
            (shellcon.FWF_ALIGNLEFT,        commctrl.LVS_ALIGNLEFT),
            (shellcon.FWF_SHOWSELALWAYS,    commctrl.LVS_SHOWSELALWAYS),
                              ]:
            if view_flags & f_flag:
                style |= l_flag

        self.hwnd_child = win32gui.CreateWindowEx(
                              win32con.WS_EX_CLIENTEDGE,
                              "SysListView32", None, style,
                              0, 0, 0, 0,
                              self.hwnd, 1000, 0, None)

        cr = win32gui.GetClientRect(self.hwnd)
        win32gui.MoveWindow(self.hwnd_child,
                            0, 0, cr[2]-cr[0], cr[3]-cr[1],
                            True)

        # Setup the columns for the view.
        lvc, extras = win32gui_struct.PackLVCOLUMN(fmt=commctrl.LVCFMT_LEFT,
                                                   subItem=1,
                                                   text='Name',
                                                   cx=300)
        win32gui.SendMessage(self.hwnd_child, commctrl.LVM_INSERTCOLUMN,
                             0, lvc)

        lvc, extras = win32gui_struct.PackLVCOLUMN(fmt=commctrl.LVCFMT_RIGHT,
                                                   subItem=1,
                                                   text='Exists',
                                                   cx=50)
        win32gui.SendMessage(self.hwnd_child, commctrl.LVM_INSERTCOLUMN,
                             1, lvc)
        # and fill it with the content
        self.Refresh() 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:59,代码来源:shell_view.py


注:本文中的win32gui.MoveWindow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。