From 53a48942a0b09d213ca6abe3d815346f4878e9c3 Mon Sep 17 00:00:00 2001 From: Byeong-Sik Jeon Date: Sat, 16 Sep 2006 09:43:07 +0900 Subject: [PATCH] notepad: Keep the modify information of edit control when toggle wrap line. --- programs/notepad/dialog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/programs/notepad/dialog.c b/programs/notepad/dialog.c index a78b75b4990..a4f7de58e56 100644 --- a/programs/notepad/dialog.c +++ b/programs/notepad/dialog.c @@ -597,6 +597,7 @@ VOID DIALOG_EditTimeDate(VOID) VOID DIALOG_EditWrap(VOID) { + BOOL modify = FALSE; static const WCHAR editW[] = { 'e','d','i','t',0 }; DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | ES_AUTOVSCROLL | ES_MULTILINE; @@ -612,6 +613,7 @@ VOID DIALOG_EditWrap(VOID) return; } GetWindowText(Globals.hEdit, pTemp, size); + modify = SendMessage(Globals.hEdit, EM_GETMODIFY, 0, 0); DestroyWindow(Globals.hEdit); GetClientRect(Globals.hMainWnd, &rc); if( Globals.bWrapLongLines ) dwStyle |= WS_HSCROLL | ES_AUTOHSCROLL; @@ -620,6 +622,7 @@ VOID DIALOG_EditWrap(VOID) NULL, Globals.hInstance, NULL); SendMessage(Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, (LPARAM)FALSE); SetWindowTextW(Globals.hEdit, pTemp); + SendMessage(Globals.hEdit, EM_SETMODIFY, (WPARAM)modify, 0); SetFocus(Globals.hEdit); HeapFree(GetProcessHeap(), 0, pTemp);