Skip to content

Commit

Permalink
#304 add a check for CW_USEDEFAULT just to be sure
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed Apr 16, 2024
1 parent 36bf42a commit 18c1528
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/winapi_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1360,8 +1360,15 @@ HWND WINAPI fake_CreateWindowExA(
/* Limit window size to max surface size (Dune2000 1.02) */
if (dwStyle & WS_POPUP)
{
nWidth = min(nWidth, 16384);
nHeight = min(nHeight, 16384);
if (nWidth != CW_USEDEFAULT)
{
nWidth = min(nWidth, 16384);
}

if (nHeight != CW_USEDEFAULT)
{
nHeight = min(nHeight, 16384);
}
}

return real_CreateWindowExA(
Expand Down

0 comments on commit 18c1528

Please sign in to comment.