From 9f04eb25d90819640f57ca64cfe952d22f41160c Mon Sep 17 00:00:00 2001 From: xiaokaixuan Date: Fri, 11 Apr 2025 15:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=86=E5=89=B2=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E5=8D=A1=E9=A1=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dependency/MainDlg.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dependency/MainDlg.cpp b/dependency/MainDlg.cpp index 7fd1818..2ab9920 100644 --- a/dependency/MainDlg.cpp +++ b/dependency/MainDlg.cpp @@ -652,9 +652,11 @@ LRESULT CMainDlg::OnLButtonDown(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOO int y = GET_Y_LPARAM(lParam); if (x >= left_spliter_xpos_ - kSpliterHitTestWidth && x <= left_spliter_xpos_ + kSpliterHitTestWidth) { left_splitting = true; + ::SetCapture(m_hWnd); } else if (y >= right_spliter_ypos - kSpliterHitTestWidth && y <= right_spliter_ypos + kSpliterHitTestWidth) { right_splitting = true; + ::SetCapture(m_hWnd); } return 0; } @@ -678,14 +680,9 @@ LRESULT CMainDlg::OnMouseMove(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& int y = GET_Y_LPARAM(lParam); if (x >= left_spliter_xpos_ - kSpliterHitTestWidth && x <= left_spliter_xpos_ + kSpliterHitTestWidth) { ::SetCursor(left_spliter_cursor); - ::SetCapture(m_hWnd); } else if (y >= right_spliter_ypos - kSpliterHitTestWidth && y <= right_spliter_ypos + kSpliterHitTestWidth) { ::SetCursor(right_spliter_cursor); - ::SetCapture(m_hWnd); - } - else { - ::ReleaseCapture(); } if (wParam == MK_LBUTTON && (left_splitting || right_splitting)) { RECT rc; @@ -703,7 +700,7 @@ LRESULT CMainDlg::OnMouseMove(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& right_spliter_ypos = y; } //根据新的分界位置发送WM_SIZE消息,重新调整左右控件的位置 - SendMessage(m_hWnd, WM_SIZE, 0, MAKELPARAM(rc.right, rc.bottom)); + ::PostMessage(m_hWnd, WM_SIZE, 0, MAKELPARAM(rc.right, rc.bottom)); } return 0; }