DockingBar.py 文件源码

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

项目:CodeReader 作者: jasonrbr 项目源码 文件源码
def OnWindowPosChanged(self, msg):
        if self.GetSafeHwnd()==0 or self.dialog is None:
            return 0
        lparam = msg[3]
        """ LPARAM used with WM_WINDOWPOSCHANGED:
            typedef struct {
                HWND hwnd;
                HWND hwndInsertAfter;
                int x;
                int y;
                int cx;
                int cy;
                UINT flags;} WINDOWPOS;
        """
        format = "PPiiiii"
        bytes = win32ui.GetBytes( lparam, struct.calcsize(format) )
        hwnd, hwndAfter, x, y, cx, cy, flags = struct.unpack(format, bytes)

        if self.bInRecalcNC:
            rc = self.GetClientRect()
            self.dialog.MoveWindow(rc)
            return 0
        # Find on which side are we docked
        nDockBarID = self.GetParent().GetDlgCtrlID()
        # Return if dropped at same location
        # no docking side change and no size change
        if (nDockBarID == self.nDockBarID) and \
            (flags & win32con.SWP_NOSIZE) and \
            ((self._obj_.dwStyle & afxres.CBRS_BORDER_ANY) != afxres.CBRS_BORDER_ANY):
            return
        self.nDockBarID = nDockBarID

        # Force recalc the non-client area
        self.bInRecalcNC = 1
        try:
            swpflags = win32con.SWP_NOSIZE | win32con.SWP_NOMOVE | win32con.SWP_NOZORDER | win32con.SWP_FRAMECHANGED
            self.SetWindowPos(0, (0,0,0,0), swpflags)
        finally:
            self.bInRecalcNC = 0
        return 0

    # This is a virtual and not a message hook.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号