diff --git a/source/platform/win32/base_sysfb.cpp b/source/platform/win32/base_sysfb.cpp
index b185d33b9..ade8299b2 100644
--- a/source/platform/win32/base_sysfb.cpp
+++ b/source/platform/win32/base_sysfb.cpp
@@ -59,6 +59,7 @@ extern "C" {
     __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
     __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;	
 }
+void GetRefreshRate(HWND hWnd);
 
 EXTERN_CVAR(Int, vid_defwidth)
 EXTERN_CVAR(Int, vid_defheight)
@@ -339,6 +340,7 @@ void SystemBaseFrameBuffer::PositionWindow(bool fullscreen, bool initialcall)
 	}
 	m_Fullscreen = fullscreen;
 	SetSize(GetClientWidth(), GetClientHeight());
+	GetRefreshRate(Window);
 }
 
 //==========================================================================
diff --git a/source/platform/win32/i_input.cpp b/source/platform/win32/i_input.cpp
index b0083b30d..53e413f3a 100644
--- a/source/platform/win32/i_input.cpp
+++ b/source/platform/win32/i_input.cpp
@@ -330,6 +330,22 @@ bool CallHook(FInputDevice *device, HWND hWnd, UINT message, WPARAM wParam, LPAR
 	return device->WndProcHook(hWnd, message, wParam, lParam, result);
 }
 
+void GetRefreshRate(HWND hWnd)
+{
+	HMONITOR moni = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST);
+	MONITORINFOEXA moninf;
+	moninf.cbSize = sizeof(moninf);
+	if (GetMonitorInfoA(moni, (LPMONITORINFO)&moninf))
+	{
+		DEVMODEA dm;
+		dm.dmSize = sizeof(DEVMODEA);
+		if (EnumDisplaySettingsA(moninf.szDevice, ENUM_CURRENT_SETTINGS, &dm))
+		{
+			refreshfreq = dm.dmDisplayFrequency;
+		}
+	}
+}
+
 LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
 	LRESULT result;
@@ -417,6 +433,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 		break;
 
 	case WM_SETFOCUS:
+		GetRefreshRate(hWnd);
 		I_CheckNativeMouse (false, false);	// This cannot call the event handler. Doing it from here is unsafe.
 		break;
 
@@ -461,6 +478,8 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 		break;
 
 	case WM_DISPLAYCHANGE:
+		GetRefreshRate(hWnd);
+		// fall through
 	case WM_STYLECHANGED:
 		return DefWindowProc(hWnd, message, wParam, lParam);