Copy now uses GMEM_MOVEABLE

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@948 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2002-09-06 21:38:30 +00:00
parent 64e81bd4c7
commit cabd90ddf7

View file

@ -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();
}