Skip to content

Commit

Permalink
Try to fix #15 restore window position is incorrect
Browse files Browse the repository at this point in the history
 - Get monitor handle from HWND using MONITOR_DEFAULTTONEAREST param

Signed-off-by: jiajia_deng <2894220@gmail.com>
  • Loading branch information
nmgwddj committed May 24, 2019
1 parent 1b4fac0 commit 9ee965d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tool_kits/duilib/Utils/WinImplBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ LRESULT WindowImplBase::OnWindowPosChanging(UINT uMsg, WPARAM wParam, LPARAM lPa
{
POINT pt = { 0, 0 };
HMONITOR hMontorPrimary = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY);
HMONITOR hMonitorTo = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTOPRIMARY);
HMONITOR hMonitorTo = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);

if (hMonitorTo != hMontorPrimary)
{
Expand Down

0 comments on commit 9ee965d

Please sign in to comment.