make borderless popup windows style optional

This commit is contained in:
somewhatlurker
2019-09-14 15:07:58 +10:00
parent a1d69543d4
commit d43ded2060
4 changed files with 11 additions and 1 deletions
@@ -74,7 +74,12 @@ int hookedCreateWindow(const char* title, void(__cdecl* exit_function)(int))
HDC hDev = wglGetCurrentDC(); // get handle to current opengl device context
HWND hWnd = WindowFromDC(hDev); // convert it to a window handle
SetWindowLongPtr(hWnd, GWL_STYLE, WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); // set no border (visible to ensure something is shown immediately)
LONG_PTR wndStyle = WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; // set no border (visible to ensure something is shown immediately)
if (nPopupBorderless)
wndStyle |= WS_POPUP;
SetWindowLongPtr(hWnd, GWL_STYLE, wndStyle);
SetWindowPos(hWnd, HWND_TOP, wndX, wndY, nWidth, nHeight, SWP_FRAMECHANGED); // adjust position to apply new style
printf("[Render Manager] Borderless mode.\n");
@@ -35,6 +35,8 @@ int nIntResHeight = GetPrivateProfileIntW(L"resolution", L"r.height", 720, CONFI
int nBitDepth = GetPrivateProfileIntW(L"resolution", L"bitdepth", 32, CONFIG_FILE);
int nRefreshRate = GetPrivateProfileIntW(L"resolution", L"refreshrate", 60, CONFIG_FILE);
int nPopupBorderless = GetPrivateProfileIntW(L"resolution", L"borderless.popup", TRUE, CONFIG_FILE);
int nFpsLimit = GetPrivateProfileIntW(L"graphics", L"fps.limit", 60, CONFIG_FILE);
int nUseLightLimiter = GetPrivateProfileIntW(L"graphics", L"fps.limit.lightmode", TRUE, CONFIG_FILE);
int nVerboseLimiter = GetPrivateProfileIntW(L"graphics", L"fps.limit.verbose", FALSE, CONFIG_FILE);