| Index: ddraw/glRenderer.cpp |
| — | — | @@ -1718,7 +1718,21 @@ |
| 1719 | 1719 | wndrect.top = dxglcfg.WindowY;
|
| 1720 | 1720 | wndrect.right = dxglcfg.WindowX + dxglcfg.WindowWidth;
|
| 1721 | 1721 | wndrect.bottom = dxglcfg.WindowY + dxglcfg.WindowHeight;
|
| | 1722 | + AdjustWindowRectEx(&wndrect, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), FALSE,
|
| | 1723 | + (winstyleex | WS_EX_APPWINDOW));
|
| 1722 | 1724 | }
|
| | 1725 | + else if (dxglcfg.WindowPosition == 2)
|
| | 1726 | + {
|
| | 1727 | + wndrect.left = wndrect.top = 0;
|
| | 1728 | + wndrect.right = dxglcfg.WindowWidth;
|
| | 1729 | + wndrect.bottom = dxglcfg.WindowHeight;
|
| | 1730 | + AdjustWindowRectEx(&wndrect, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), FALSE,
|
| | 1731 | + (winstyleex | WS_EX_APPWINDOW));
|
| | 1732 | + wndrect.right -= wndrect.left;
|
| | 1733 | + wndrect.left = 0;
|
| | 1734 | + wndrect.bottom -= wndrect.top;
|
| | 1735 | + wndrect.top = 0;
|
| | 1736 | + }
|
| 1723 | 1737 | else
|
| 1724 | 1738 | {
|
| 1725 | 1739 | screenx = GetSystemMetrics(SM_CXSCREEN);
|
| — | — | @@ -1727,9 +1741,9 @@ |
| 1728 | 1742 | wndrect.bottom = dxglcfg.WindowHeight + (screeny / 2) - (dxglcfg.WindowHeight / 2);
|
| 1729 | 1743 | wndrect.left = (screenx / 2) - (dxglcfg.WindowWidth / 2);
|
| 1730 | 1744 | wndrect.top = (screeny / 2) - (dxglcfg.WindowHeight / 2);
|
| | 1745 | + AdjustWindowRectEx(&wndrect, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), FALSE,
|
| | 1746 | + (winstyleex | WS_EX_APPWINDOW));
|
| 1731 | 1747 | }
|
| 1732 | | - AdjustWindowRectEx(&wndrect, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), FALSE,
|
| 1733 | | - (winstyleex | WS_EX_APPWINDOW));
|
| 1734 | 1748 | SetWindowPos(This->hWnd, 0, wndrect.left, wndrect.top, wndrect.right - wndrect.left,
|
| 1735 | 1749 | wndrect.bottom - wndrect.top, SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOOWNERZORDER);
|
| 1736 | 1750 | break;
|
| — | — | @@ -1745,7 +1759,19 @@ |
| 1746 | 1760 | wndrect.top = dxglcfg.WindowY;
|
| 1747 | 1761 | wndrect.right = dxglcfg.WindowX + dxglcfg.WindowWidth;
|
| 1748 | 1762 | wndrect.bottom = dxglcfg.WindowY + dxglcfg.WindowHeight;
|
| | 1763 | + AdjustWindowRectEx(&wndrect, winstyle | WS_OVERLAPPEDWINDOW, FALSE, (winstyleex | WS_EX_APPWINDOW));
|
| 1749 | 1764 | }
|
| | 1765 | + else if (dxglcfg.WindowPosition == 2)
|
| | 1766 | + {
|
| | 1767 | + wndrect.left = wndrect.top = 0;
|
| | 1768 | + wndrect.right = dxglcfg.WindowWidth;
|
| | 1769 | + wndrect.bottom = dxglcfg.WindowHeight;
|
| | 1770 | + AdjustWindowRectEx(&wndrect, winstyle | WS_OVERLAPPEDWINDOW, FALSE, (winstyleex | WS_EX_APPWINDOW));
|
| | 1771 | + wndrect.right -= wndrect.left;
|
| | 1772 | + wndrect.left = 0;
|
| | 1773 | + wndrect.bottom -= wndrect.top;
|
| | 1774 | + wndrect.top = 0;
|
| | 1775 | + }
|
| 1750 | 1776 | else
|
| 1751 | 1777 | {
|
| 1752 | 1778 | screenx = GetSystemMetrics(SM_CXSCREEN);
|
| — | — | @@ -1754,8 +1780,8 @@ |
| 1755 | 1781 | wndrect.bottom = dxglcfg.WindowHeight + (screeny / 2) - (dxglcfg.WindowHeight / 2);
|
| 1756 | 1782 | wndrect.left = (screenx / 2) - (dxglcfg.WindowWidth / 2);
|
| 1757 | 1783 | wndrect.top = (screeny / 2) - (dxglcfg.WindowHeight / 2);
|
| | 1784 | + AdjustWindowRectEx(&wndrect, winstyle | WS_OVERLAPPEDWINDOW, FALSE, (winstyleex | WS_EX_APPWINDOW));
|
| 1758 | 1785 | }
|
| 1759 | | - AdjustWindowRectEx(&wndrect, winstyle | WS_OVERLAPPEDWINDOW, FALSE, (winstyleex | WS_EX_APPWINDOW));
|
| 1760 | 1786 | wndplace.length = sizeof(WINDOWPLACEMENT);
|
| 1761 | 1787 | GetWindowPlacement(This->hWnd, &wndplace);
|
| 1762 | 1788 | wndplace.flags = WPF_ASYNCWINDOWPLACEMENT;
|
| — | — | @@ -1777,6 +1803,12 @@ |
| 1778 | 1804 | wndrect.right = dxglcfg.WindowX + dxglcfg.WindowWidth;
|
| 1779 | 1805 | wndrect.bottom = dxglcfg.WindowY + dxglcfg.WindowHeight;
|
| 1780 | 1806 | }
|
| | 1807 | + else if (dxglcfg.WindowPosition == 2)
|
| | 1808 | + {
|
| | 1809 | + wndrect.left = wndrect.top = 0;
|
| | 1810 | + wndrect.right = dxglcfg.WindowWidth;
|
| | 1811 | + wndrect.bottom = dxglcfg.WindowHeight;
|
| | 1812 | + }
|
| 1781 | 1813 | else
|
| 1782 | 1814 | {
|
| 1783 | 1815 | screenx = GetSystemMetrics(SM_CXSCREEN);
|
| — | — | @@ -2200,7 +2232,24 @@ |
| 2201 | 2233 | else hasmenu = FALSE;
|
| 2202 | 2234 | UnadjustWindowRectEx(&wndrect, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX | WS_POPUP),
|
| 2203 | 2235 | hasmenu, winstyleex | WS_EX_APPWINDOW);
|
| | 2236 | + wndrect.right = wndrect.left + width;
|
| | 2237 | + wndrect.bottom = wndrect.top + height;
|
| | 2238 | + AdjustWindowRectEx(&wndrect, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), FALSE,
|
| | 2239 | + (winstyleex | WS_EX_APPWINDOW));
|
| 2204 | 2240 | }
|
| | 2241 | + else if (dxglcfg.WindowPosition == 2)
|
| | 2242 | + {
|
| | 2243 | + wndrect.left = 0;
|
| | 2244 | + wndrect.top = 0;
|
| | 2245 | + wndrect.right = width;
|
| | 2246 | + wndrect.bottom = height;
|
| | 2247 | + AdjustWindowRectEx(&wndrect, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), FALSE,
|
| | 2248 | + (winstyleex | WS_EX_APPWINDOW));
|
| | 2249 | + wndrect.right -= wndrect.left;
|
| | 2250 | + wndrect.left = 0;
|
| | 2251 | + wndrect.bottom -= wndrect.top;
|
| | 2252 | + wndrect.top = 0;
|
| | 2253 | + }
|
| 2205 | 2254 | else
|
| 2206 | 2255 | {
|
| 2207 | 2256 | screenx = GetSystemMetrics(SM_CXSCREEN);
|
| — | — | @@ -2207,15 +2256,15 @@ |
| 2208 | 2257 | screeny = GetSystemMetrics(SM_CYSCREEN);
|
| 2209 | 2258 | wndrect.left = (screenx / 2) - (width / 2);
|
| 2210 | 2259 | wndrect.top = (screeny / 2) - (height / 2);
|
| | 2260 | + wndrect.right = wndrect.left + width;
|
| | 2261 | + wndrect.bottom = wndrect.top + height;
|
| | 2262 | + AdjustWindowRectEx(&wndrect, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), FALSE,
|
| | 2263 | + (winstyleex | WS_EX_APPWINDOW));
|
| 2211 | 2264 | }
|
| 2212 | | - wndrect.right = wndrect.left + width;
|
| 2213 | | - wndrect.bottom = wndrect.top + height;
|
| 2214 | 2265 | dxglcfg.WindowX = wndrect.left;
|
| 2215 | 2266 | dxglcfg.WindowY = wndrect.top;
|
| 2216 | 2267 | dxglcfg.WindowWidth = wndrect.right - wndrect.left;
|
| 2217 | 2268 | dxglcfg.WindowHeight = wndrect.bottom - wndrect.top;
|
| 2218 | | - AdjustWindowRectEx(&wndrect, (winstyle | WS_OVERLAPPEDWINDOW) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), FALSE,
|
| 2219 | | - (winstyleex | WS_EX_APPWINDOW));
|
| 2220 | 2269 | SetWindowPos(newwnd, 0, wndrect.left, wndrect.top, wndrect.right - wndrect.left,
|
| 2221 | 2270 | wndrect.bottom - wndrect.top, SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOOWNERZORDER);
|
| 2222 | 2271 | SaveWindowSettings(&dxglcfg);
|
| — | — | @@ -2239,7 +2288,35 @@ |
| 2240 | 2289 | hasmenu, (winstyleex | WS_EX_APPWINDOW));
|
| 2241 | 2290 | UnadjustWindowRectEx(&wndrect2, (winstyle | WS_OVERLAPPEDWINDOW) & ~WS_POPUP,
|
| 2242 | 2291 | hasmenu, (winstyleex | WS_EX_APPWINDOW));
|
| | 2292 | + if (!dxglcfg.NoResizeWindow)
|
| | 2293 | + {
|
| | 2294 | + wndrect.right = wndrect.left + width;
|
| | 2295 | + wndrect.bottom = wndrect.top + height;
|
| | 2296 | + }
|
| 2243 | 2297 | }
|
| | 2298 | + else if (dxglcfg.WindowPosition == 2)
|
| | 2299 | + {
|
| | 2300 | + if (dxglcfg.NoResizeWindow)
|
| | 2301 | + {
|
| | 2302 | + GetWindowRect(newwnd, &wndrect2);
|
| | 2303 | + if (GetMenu(newwnd)) hasmenu = TRUE;
|
| | 2304 | + else hasmenu = FALSE;
|
| | 2305 | + UnadjustWindowRectEx(&wndrect2, (winstyle | WS_OVERLAPPEDWINDOW) & ~WS_POPUP,
|
| | 2306 | + hasmenu, (winstyleex | WS_EX_APPWINDOW));
|
| | 2307 | + glDirectDraw7_SetWindowSize(This->ddInterface,
|
| | 2308 | + wndrect2.right - wndrect2.left, wndrect2.bottom - wndrect2.top);
|
| | 2309 | + break;
|
| | 2310 | + }
|
| | 2311 | + wndrect.left = 0;
|
| | 2312 | + wndrect.top = 0;
|
| | 2313 | + wndrect.right = width;
|
| | 2314 | + wndrect.bottom = height;
|
| | 2315 | + AdjustWindowRectEx(&wndrect, winstyle | WS_OVERLAPPEDWINDOW, FALSE, (winstyleex | WS_EX_APPWINDOW));
|
| | 2316 | + wndrect.right -= wndrect.left;
|
| | 2317 | + wndrect.left = 0;
|
| | 2318 | + wndrect.bottom -= wndrect.top;
|
| | 2319 | + wndrect.top = 0;
|
| | 2320 | + }
|
| 2244 | 2321 | else
|
| 2245 | 2322 | {
|
| 2246 | 2323 | if (dxglcfg.NoResizeWindow)
|
| — | — | @@ -2257,17 +2334,18 @@ |
| 2258 | 2335 | screeny = GetSystemMetrics(SM_CYSCREEN);
|
| 2259 | 2336 | wndrect.left = (screenx / 2) - (width / 2);
|
| 2260 | 2337 | wndrect.top = (screeny / 2) - (height / 2);
|
| | 2338 | + if (!dxglcfg.NoResizeWindow)
|
| | 2339 | + {
|
| | 2340 | + wndrect.right = wndrect.left + width;
|
| | 2341 | + wndrect.bottom = wndrect.top + height;
|
| | 2342 | + }
|
| 2261 | 2343 | }
|
| 2262 | | - if (!dxglcfg.NoResizeWindow)
|
| 2263 | | - {
|
| 2264 | | - wndrect.right = wndrect.left + width;
|
| 2265 | | - wndrect.bottom = wndrect.top + height;
|
| 2266 | | - }
|
| 2267 | 2344 | dxglcfg.WindowX = wndrect.left;
|
| 2268 | 2345 | dxglcfg.WindowY = wndrect.top;
|
| 2269 | 2346 | dxglcfg.WindowWidth = wndrect.right - wndrect.left;
|
| 2270 | 2347 | dxglcfg.WindowHeight = wndrect.bottom - wndrect.top;
|
| 2271 | | - AdjustWindowRectEx(&wndrect, winstyle | WS_OVERLAPPEDWINDOW, FALSE, (winstyleex | WS_EX_APPWINDOW));
|
| | 2348 | + if(dxglcfg.WindowPosition != 2)
|
| | 2349 | + AdjustWindowRectEx(&wndrect, winstyle | WS_OVERLAPPEDWINDOW, FALSE, (winstyleex | WS_EX_APPWINDOW));
|
| 2272 | 2350 | wndplace.flags = WPF_ASYNCWINDOWPLACEMENT;
|
| 2273 | 2351 | if (!dxglcfg.NoResizeWindow) wndplace.showCmd = SW_SHOWNORMAL;
|
| 2274 | 2352 | wndplace.rcNormalPosition = wndrect;
|
| — | — | @@ -2285,6 +2363,11 @@ |
| 2286 | 2364 | screenx = GetSystemMetrics(SM_CXSCREEN);
|
| 2287 | 2365 | screeny = GetSystemMetrics(SM_CYSCREEN);
|
| 2288 | 2366 | if (dxglcfg.WindowPosition == 1) GetWindowRect(newwnd, &wndrect);
|
| | 2367 | + else if (dxglcfg.WindowPosition == 2)
|
| | 2368 | + {
|
| | 2369 | + wndrect.left = 0;
|
| | 2370 | + wndrect.top = 0;
|
| | 2371 | + }
|
| 2289 | 2372 | else
|
| 2290 | 2373 | {
|
| 2291 | 2374 | screenx = GetSystemMetrics(SM_CXSCREEN);
|
| Index: dxglcfg/dxglcfg.cpp |
| — | — | @@ -3152,6 +3152,8 @@ |
| 3153 | 3153 | SendDlgItemMessage(hTabs[3], IDC_WINDOWPOS, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 3154 | 3154 | _tcscpy(buffer, _T("Saved position"));
|
| 3155 | 3155 | SendDlgItemMessage(hTabs[3], IDC_WINDOWPOS, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| | 3156 | + _tcscpy(buffer, _T("Top left"));
|
| | 3157 | + SendDlgItemMessage(hTabs[3], IDC_WINDOWPOS, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 3156 | 3158 | SendDlgItemMessage(hTabs[3], IDC_WINDOWPOS, CB_SETCURSEL, cfg->WindowPosition, 0);
|
| 3157 | 3159 | // Remember window position
|
| 3158 | 3160 | if (cfg->RememberWindowPosition) SendDlgItemMessage(hTabs[3], IDC_REMEMBERWINDOWPOS, BM_SETCHECK, BST_CHECKED, 0);
|