[NOTEPAD] Handle serialized maximized state (#5806)

Fixes a bug where if you close Notepad while it is maximized, the next time Notepad is started it will start with its window placed as if maximized but it is still in the SW_RESTORE state and the "real normal placement" is lost.

SetWindowPlacement also takes care of making sure the window is placed correctly on the monitor workarea.
This commit is contained in:
Whindmar Saksit 2024-09-02 23:13:28 +02:00 committed by GitHub
parent 07abea90d9
commit 814f3a15f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 54 additions and 40 deletions

View file

@ -84,7 +84,6 @@ typedef struct
FINDREPLACE find;
WNDPROC EditProc;
RECT main_rect;
BOOL bWasModified;
} NOTEPAD_GLOBALS;
@ -93,7 +92,7 @@ extern NOTEPAD_GLOBALS Globals;
BOOL ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, EOLN *piEoln);
BOOL WriteText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, ENCODING encFile, EOLN iEoln);
void NOTEPAD_LoadSettingsFromRegistry(void);
void NOTEPAD_LoadSettingsFromRegistry(PWINDOWPLACEMENT pWP);
void NOTEPAD_SaveSettingsToRegistry(void);
BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bShowAlert);