Skip to content

Commit

Permalink
Fix window handle
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Oct 2, 2024
1 parent 75ed1d6 commit bef166b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 7229
#define BUILD_NUMBER 7230
16 changes: 8 additions & 8 deletions ddraw/IDirectDrawX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3277,21 +3277,21 @@ HRESULT m_IDirectDrawX::CreateD9Device(char* FunctionName)

// Windows position
PostMessage(hWnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)&winpos);
PostMessage(DisplayMode.hWnd, WM_NCCALCSIZE, TRUE, (LPARAM)&NCCalc);
PostMessage(DisplayMode.hWnd, WM_NCPAINT, TRUE, NULL);
PostMessage(DisplayMode.hWnd, WM_ERASEBKGND, TRUE, NULL);
PostMessage(hWnd, WM_NCCALCSIZE, TRUE, (LPARAM)&NCCalc);
PostMessage(hWnd, WM_NCPAINT, TRUE, NULL);
PostMessage(hWnd, WM_ERASEBKGND, TRUE, NULL);
PostMessage(hWnd, WM_WINDOWPOSCHANGED, 0, (LPARAM)&winpos);

// Window move and size
PostMessage(hWnd, WM_MOVE, 0, MAKELPARAM(NewRect.left, NewRect.top));
PostMessage(hWnd, WM_SIZE, SIZE_RESTORED, MAKELPARAM(NewRect.right - NewRect.left, NewRect.bottom - NewRect.top));

// Window focus and activate app
PostMessage(DisplayMode.hWnd, WM_IME_SETCONTEXT, TRUE, ISC_SHOWUIALL);
PostMessage(DisplayMode.hWnd, WM_SETFOCUS, NULL, NULL);
PostMessage(DisplayMode.hWnd, WM_SYNCPAINT, (WPARAM)32, NULL);
PostMessage(DisplayMode.hWnd, WM_ACTIVATEAPP, TRUE, (LPARAM)GetWindowThreadProcessId(hWnd, nullptr));
PostMessage(DisplayMode.hWnd, WM_DWMNCRENDERINGCHANGED, NULL, NULL);
PostMessage(hWnd, WM_IME_SETCONTEXT, TRUE, ISC_SHOWUIALL);
PostMessage(hWnd, WM_SETFOCUS, NULL, NULL);
PostMessage(hWnd, WM_SYNCPAINT, (WPARAM)32, NULL);
PostMessage(hWnd, WM_ACTIVATEAPP, TRUE, (LPARAM)GetWindowThreadProcessId(hWnd, nullptr));
PostMessage(hWnd, WM_DWMNCRENDERINGCHANGED, NULL, NULL);
}

// Store display frequency
Expand Down

0 comments on commit bef166b

Please sign in to comment.