diff --git a/src/Dialogs.c b/src/Dialogs.c index 4c9be564a..29c081733 100644 --- a/src/Dialogs.c +++ b/src/Dialogs.c @@ -4431,8 +4431,8 @@ WININFO GetMyWindowPlacement(HWND hwnd, MONITORINFO *hMonitorInfo, const int off wi.y = wndpl.rcNormalPosition.top + offset; wi.cx = wndpl.rcNormalPosition.right - wndpl.rcNormalPosition.left; wi.cy = wndpl.rcNormalPosition.bottom - wndpl.rcNormalPosition.top; - wi.max = IsZoomed(hwnd) || (wndpl.flags & WPF_RESTORETOMAXIMIZED); - wi.zoom = SciCall_GetZoom(); + wi.max = (hwnd ? IsZoomed(hwnd) : false) || (wndpl.flags & WPF_RESTORETOMAXIMIZED); + wi.zoom = hwnd ? SciCall_GetZoom() : 100; wi.dpi = Scintilla_GetWindowDPI(hwnd); if (Settings2.LaunchInstanceFullVisible) { diff --git a/src/Notepad3.c b/src/Notepad3.c index d1d79c0e7..42ad004a0 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -754,6 +754,8 @@ static void _InitGlobals() FileWatching.flagChangeNotify = FWM_DONT_CARE; FileWatching.FileWatchingMode = FWM_DONT_CARE; FileWatching.MonitoringLog = false; + + g_IniWinInfo = GetFactoryDefaultWndPos(2); } @@ -1452,6 +1454,7 @@ HWND InitInstance(const HINSTANCE hInstance, LPCWSTR pszCmdLine, int nCmdShow) hInstance, NULL); + g_IniWinInfo.dpi = Scintilla_GetWindowDPI(hwndMain); // correct dpi SnapToWinInfoPos(hwndMain, g_IniWinInfo, SCR_NORMAL); if (g_IniWinInfo.max) {