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:
parent
64e81bd4c7
commit
cabd90ddf7
1 changed files with 3 additions and 1 deletions
|
@ -37,11 +37,13 @@ void SetBranding(HWND hwnd) {
|
||||||
|
|
||||||
void CopyToClipboard(HWND hwnd) {
|
void CopyToClipboard(HWND hwnd) {
|
||||||
int len=SendDlgItemMessage(hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
|
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;
|
if (!hwnd||!OpenClipboard(hwnd)||!existing_text) return;
|
||||||
EmptyClipboard();
|
EmptyClipboard();
|
||||||
existing_text[0]=0;
|
existing_text[0]=0;
|
||||||
GetDlgItemText(hwnd, IDC_LOGWIN, existing_text, len);
|
GetDlgItemText(hwnd, IDC_LOGWIN, existing_text, len);
|
||||||
|
GlobalUnlock(mem);
|
||||||
SetClipboardData(CF_TEXT,existing_text);
|
SetClipboardData(CF_TEXT,existing_text);
|
||||||
CloseClipboard();
|
CloseClipboard();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue