fix: #176 #177 Desktop control does not work properly

This commit is contained in:
yuanyuanxiang
2025-08-02 14:35:53 +08:00
parent 6849f66f1e
commit ef7e065cc8
2 changed files with 13 additions and 16 deletions

View File

@@ -773,11 +773,11 @@ void CHideScreenSpyDlg::SendScaledMouseMessage(MSG* pMsg, bool makeLP) {
}
MYMSG msg(*pMsg);
auto low = ((LONG)LOWORD(pMsg->lParam)) * m_wZoom;
auto high = ((LONG)HIWORD(pMsg->lParam)) * m_hZoom;
LONG low = ((LONG)LOWORD(pMsg->lParam)) * m_wZoom;
LONG high = ((LONG)HIWORD(pMsg->lParam)) * m_hZoom;
if(makeLP) msg.lParam = MAKELPARAM(low, high);
msg.pt.x = (int)(low + m_rect.left);
msg.pt.y = (int)(high + m_rect.top);
msg.pt.x = low + m_rect.left;
msg.pt.y = high + m_rect.top;
SendCommand(msg);
}

View File

@@ -182,9 +182,8 @@ BOOL CScreenSpyDlg::OnInitDialog()
SetClassLongPtr(m_hWnd, GCLP_HCURSOR, m_bIsCtrl ? (LONG_PTR)m_hRemoteCursor : (LONG_PTR)LoadCursor(NULL, IDC_NO));
GetClientRect(&m_CRect);
ScreenToClient(m_CRect);
m_wZoom = ((double)m_BitmapInfor_Full->bmiHeader.biWidth) / ((double)(m_CRect.right - m_CRect.left));
m_hZoom = ((double)m_BitmapInfor_Full->bmiHeader.biHeight) / ((double)(m_CRect.bottom - m_CRect.top));
m_wZoom = ((double)m_BitmapInfor_Full->bmiHeader.biWidth) / ((double)(m_CRect.Width()));
m_hZoom = ((double)m_BitmapInfor_Full->bmiHeader.biHeight) / ((double)(m_CRect.Height()));
ShowScrollBar(SB_BOTH, !m_bAdaptiveSize);
SendNext();
@@ -560,11 +559,12 @@ void CScreenSpyDlg::SendScaledMouseMessage(MSG* pMsg, bool makeLP) {
return;
MYMSG msg(*pMsg);
auto low = m_bAdaptiveSize ? ((LONG)LOWORD(pMsg->lParam)) * m_wZoom : LOWORD(pMsg->lParam) + m_ulHScrollPos;
auto high = m_bAdaptiveSize ? ((LONG)HIWORD(pMsg->lParam)) * m_hZoom : HIWORD(pMsg->lParam) + m_ulVScrollPos;
LONG x = LOWORD(pMsg->lParam), y = HIWORD(pMsg->lParam);
LONG low = m_bAdaptiveSize ? x * m_wZoom : x + m_ulHScrollPos;
LONG high = m_bAdaptiveSize ? y * m_hZoom : y + m_ulVScrollPos;
if (makeLP) msg.lParam = MAKELPARAM(low, high);
msg.pt.x = (int)low;
msg.pt.y = (int)high;
msg.pt.x = low;
msg.pt.y = high;
SendCommand(&msg);
}
@@ -836,9 +836,6 @@ void CScreenSpyDlg::OnSize(UINT nType, int cx, int cy)
return;
GetClientRect(&m_CRect);
ScreenToClient(m_CRect);
if (!m_bIsFirst) {
m_wZoom = ((double)m_BitmapInfor_Full->bmiHeader.biWidth) / ((double)(m_CRect.right - m_CRect.left));
m_hZoom = ((double)m_BitmapInfor_Full->bmiHeader.biHeight) / ((double)(m_CRect.bottom - m_CRect.top));
}
m_wZoom = ((double)m_BitmapInfor_Full->bmiHeader.biWidth) / ((double)(m_CRect.Width()));
m_hZoom = ((double)m_BitmapInfor_Full->bmiHeader.biHeight) / ((double)(m_CRect.Height()));
}