From cabd90ddf7c4873325d441b49505cf293bda433d Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 6 Sep 2002 21:38:30 +0000 Subject: [PATCH] Copy now uses GMEM_MOVEABLE git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@948 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Makensisw/utils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Contrib/Makensisw/utils.cpp b/Contrib/Makensisw/utils.cpp index 197efcc8..b765d320 100644 --- a/Contrib/Makensisw/utils.cpp +++ b/Contrib/Makensisw/utils.cpp @@ -37,11 +37,13 @@ void SetBranding(HWND hwnd) { void CopyToClipboard(HWND hwnd) { int len=SendDlgItemMessage(hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0); - char *existing_text=(char*)GlobalAlloc(GPTR,len); + HGLOBAL mem = GlobalAlloc(GHND,len); + char *existing_text = (char *)GlobalLock(mem); if (!hwnd||!OpenClipboard(hwnd)||!existing_text) return; EmptyClipboard(); existing_text[0]=0; GetDlgItemText(hwnd, IDC_LOGWIN, existing_text, len); + GlobalUnlock(mem); SetClipboardData(CF_TEXT,existing_text); CloseClipboard(); }