From 18c15280ba04beb120cb2c18f0c57386e8a1fb55 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Tue, 16 Apr 2024 03:11:33 +0200 Subject: [PATCH] #304 add a check for CW_USEDEFAULT just to be sure --- src/winapi_hooks.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/winapi_hooks.c b/src/winapi_hooks.c index 3388b47..9431121 100644 --- a/src/winapi_hooks.c +++ b/src/winapi_hooks.c @@ -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(