| Index: ddraw/glRenderer.cpp |
| — | — | @@ -241,7 +241,7 @@ |
| 242 | 242 | winstyle = GetWindowLongPtrA(This->hWnd, GWL_STYLE);
|
| 243 | 243 | winstyleex = GetWindowLongPtrA(This->hWnd, GWL_EXSTYLE);
|
| 244 | 244 | SetWindowLongPtrA(This->hWnd, GWL_EXSTYLE, winstyleex | WS_EX_APPWINDOW);
|
| 245 | | - SetWindowLongPtrA(This->hWnd, GWL_STYLE, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX));
|
| | 245 | + SetWindowLongPtrA(This->hWnd, GWL_STYLE, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX | WS_POPUP));
|
| 246 | 246 | ShowWindow(This->hWnd, SW_MAXIMIZE);
|
| 247 | 247 | break;
|
| 248 | 248 | case 3: // Windowed resizable
|
| — | — | @@ -248,7 +248,7 @@ |
| 249 | 249 | winstyle = GetWindowLongPtrA(This->hWnd, GWL_STYLE);
|
| 250 | 250 | winstyleex = GetWindowLongPtrA(This->hWnd, GWL_EXSTYLE);
|
| 251 | 251 | SetWindowLongPtrA(This->hWnd, GWL_EXSTYLE, winstyleex | WS_EX_APPWINDOW);
|
| 252 | | - SetWindowLongPtrA(This->hWnd, GWL_STYLE, winstyle | WS_OVERLAPPEDWINDOW);
|
| | 252 | + SetWindowLongPtrA(This->hWnd, GWL_STYLE, (winstyle | WS_OVERLAPPEDWINDOW) & ~WS_POPUP);
|
| 253 | 253 | ShowWindow(This->hWnd, SW_MAXIMIZE);
|
| 254 | 254 | break;
|
| 255 | 255 | }
|
| — | — | @@ -634,7 +634,7 @@ |
| 635 | 635 | winstyle = GetWindowLongPtrA(newwnd, GWL_STYLE);
|
| 636 | 636 | winstyleex = GetWindowLongPtrA(newwnd, GWL_EXSTYLE);
|
| 637 | 637 | SetWindowLongPtrA(newwnd, GWL_EXSTYLE, winstyleex | WS_EX_APPWINDOW);
|
| 638 | | - SetWindowLongPtrA(newwnd, GWL_STYLE, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX));
|
| | 638 | + SetWindowLongPtrA(newwnd, GWL_STYLE, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX | WS_POPUP));
|
| 639 | 639 | ShowWindow(newwnd, SW_NORMAL);
|
| 640 | 640 | screenx = GetSystemMetrics(SM_CXSCREEN);
|
| 641 | 641 | screeny = GetSystemMetrics(SM_CYSCREEN);
|
| — | — | @@ -650,7 +650,7 @@ |
| 651 | 651 | winstyle = GetWindowLongPtrA(newwnd, GWL_STYLE);
|
| 652 | 652 | winstyleex = GetWindowLongPtrA(newwnd, GWL_EXSTYLE);
|
| 653 | 653 | SetWindowLongPtrA(newwnd, GWL_EXSTYLE, winstyleex | WS_EX_APPWINDOW);
|
| 654 | | - SetWindowLongPtrA(newwnd, GWL_STYLE, winstyle | WS_SYSMENU | WS_OVERLAPPEDWINDOW);
|
| | 654 | + SetWindowLongPtrA(newwnd, GWL_STYLE, (winstyle | WS_OVERLAPPEDWINDOW) & ~WS_POPUP);
|
| 655 | 655 | ShowWindow(newwnd, SW_NORMAL);
|
| 656 | 656 | screenx = GetSystemMetrics(SM_CXSCREEN);
|
| 657 | 657 | screeny = GetSystemMetrics(SM_CYSCREEN);
|
| Index: ddraw/hooks.c |
| — | — | @@ -320,7 +320,7 @@ |
| 321 | 321 | winstyle = GetWindowLong(hWnd, GWL_STYLE);
|
| 322 | 322 | exstyle = GetWindowLong(hWnd, GWL_EXSTYLE);
|
| 323 | 323 | if (winstyle & (WS_CAPTION | WS_THICKFRAME | WS_BORDER | WS_POPUP)) fixstyle = TRUE;
|
| 324 | | - if (winstyle & (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)) fixstyle = TRUE;
|
| | 324 | + if (exstyle & (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)) fixstyle = TRUE;
|
| 325 | 325 | if (!((r1.left == 0) && (r1.top == 0) && (r2.right == sizes[4]) && (r2.bottom == sizes[5]))) fixstyle = TRUE;
|
| 326 | 326 | if (fixstyle)
|
| 327 | 327 | {
|
| — | — | @@ -330,12 +330,44 @@ |
| 331 | 331 | }
|
| 332 | 332 | }
|
| 333 | 333 | break;
|
| 334 | | - break;
|
| 335 | 334 | case 2:
|
| 336 | 335 | // Fix non-resizable window mode
|
| | 336 | + if (lpDD7)
|
| | 337 | + {
|
| | 338 | + glDirectDraw7_GetSizes(lpDD7, sizes);
|
| | 339 | + GetClientRect(hWnd, &r2);
|
| | 340 | + winstyle = GetWindowLong(hWnd, GWL_STYLE);
|
| | 341 | + exstyle = GetWindowLong(hWnd, GWL_EXSTYLE);
|
| | 342 | + if (winstyle & (WS_THICKFRAME | WS_MAXIMIZEBOX | WS_POPUP)) fixstyle = TRUE;
|
| | 343 | + if (!(winstyle & (WS_OVERLAPPEDWINDOW & ~(WS_THICKFRAME | WS_MAXIMIZEBOX | WS_POPUP)))) fixstyle = TRUE;
|
| | 344 | + if (!(exstyle & WS_EX_APPWINDOW)) fixstyle = TRUE;
|
| | 345 | + if (!((r2.right == sizes[4]) && (r2.bottom == sizes[5]))) fixstyle = TRUE;
|
| | 346 | + if (fixstyle)
|
| | 347 | + {
|
| | 348 | + SetWindowLongPtrA(hWnd, GWL_EXSTYLE, exstyle | WS_EX_APPWINDOW);
|
| | 349 | + SetWindowLongPtrA(hWnd, GWL_STYLE, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX | WS_POPUP));
|
| | 350 | + SetWindowPos(hWnd, NULL, 0, 0, sizes[4], sizes[5], SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
|
| | 351 | + }
|
| | 352 | + }
|
| 337 | 353 | break;
|
| 338 | 354 | case 3:
|
| 339 | 355 | // Fix resizable window mode
|
| | 356 | + if (lpDD7)
|
| | 357 | + {
|
| | 358 | + glDirectDraw7_GetSizes(lpDD7, sizes);
|
| | 359 | + GetClientRect(hWnd, &r2);
|
| | 360 | + winstyle = GetWindowLong(hWnd, GWL_STYLE);
|
| | 361 | + exstyle = GetWindowLong(hWnd, GWL_EXSTYLE);
|
| | 362 | + if (winstyle & (WS_THICKFRAME | WS_MAXIMIZEBOX | WS_POPUP)) fixstyle = TRUE;
|
| | 363 | + if (!(winstyle & WS_OVERLAPPEDWINDOW)) fixstyle = TRUE;
|
| | 364 | + if (!(exstyle & WS_EX_APPWINDOW)) fixstyle = TRUE;
|
| | 365 | + if (fixstyle)
|
| | 366 | + {
|
| | 367 | + SetWindowLongPtrA(hWnd, GWL_EXSTYLE, exstyle | WS_EX_APPWINDOW);
|
| | 368 | + SetWindowLongPtrA(hWnd, GWL_STYLE, (winstyle | WS_OVERLAPPEDWINDOW) & ~WS_POPUP);
|
| | 369 | + SetWindowPos(hWnd, NULL, 0, 0, sizes[4], sizes[5], SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
|
| | 370 | + }
|
| | 371 | + }
|
| 340 | 372 | break;
|
| 341 | 373 | }
|
| 342 | 374 | }
|