From a4366836ab83e42d41529eae093a7297322ed3ed Mon Sep 17 00:00:00 2001 From: justin1014 Date: Wed, 2 Oct 2002 04:26:57 +0000 Subject: [PATCH] fixed another makensisw bug (two stray chars after text for me) -- hopefully this didn't break anything git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1264 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Makensisw/makensisw.cpp | 2 +- Contrib/Makensisw/utils.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Contrib/Makensisw/makensisw.cpp b/Contrib/Makensisw/makensisw.cpp index f30c2be0..4af71d0b 100644 --- a/Contrib/Makensisw/makensisw.cpp +++ b/Contrib/Makensisw/makensisw.cpp @@ -301,7 +301,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { } case IDM_COPYSELECTED: { - SendMessage(GetDlgItem(g_hwnd,IDC_LOGWIN), WM_COPY, 0, 0); + SendDlgItemMessage(g_hwnd,IDC_LOGWIN, WM_COPY, 0, 0); return TRUE; } case IDM_SAVE: diff --git a/Contrib/Makensisw/utils.cpp b/Contrib/Makensisw/utils.cpp index 08fd53cd..178d1ccd 100644 --- a/Contrib/Makensisw/utils.cpp +++ b/Contrib/Makensisw/utils.cpp @@ -69,7 +69,8 @@ void ClearLog(HWND hwnd) { } void LogMessage(HWND hwnd,const char *str) { - DWORD dwLength = SendDlgItemMessage(hwnd, IDC_LOGWIN, WM_GETTEXTLENGTH, 0, 0); + GETTEXTLENGTHEX tl={GTL_DEFAULT,CP_ACP}; + DWORD dwLength = SendDlgItemMessage(hwnd, IDC_LOGWIN, EM_GETTEXTLENGTHEX, (WPARAM)&tl, 0); SendDlgItemMessage(hwnd, IDC_LOGWIN, EM_SETSEL, dwLength, dwLength); SendDlgItemMessage(hwnd, IDC_LOGWIN, EM_REPLACESEL, 0, (WPARAM)str); SendDlgItemMessage(hwnd, IDC_LOGWIN, EM_SCROLLCARET, 0, 0);