1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 20:12:48 -05:00

Add a parameter to write_clip() so that windlg.c need not call term_deselect

[originally from svn r681]
This commit is contained in:
Simon Tatham
2000-10-06 12:32:25 +00:00
parent bbe7ece71f
commit 7b6106d62a
6 changed files with 22 additions and 10 deletions

View File

@ -2242,7 +2242,7 @@ void palette_reset (void) {
}
}
void write_clip (void *data, int len) {
void write_clip (void *data, int len, int must_deselect) {
HGLOBAL clipdata;
void *lock;
@ -2256,14 +2256,18 @@ void write_clip (void *data, int len) {
((unsigned char *) lock) [len] = 0;
GlobalUnlock (clipdata);
SendMessage (hwnd, WM_IGNORE_CLIP, TRUE, 0);
if (!must_deselect)
SendMessage (hwnd, WM_IGNORE_CLIP, TRUE, 0);
if (OpenClipboard (hwnd)) {
EmptyClipboard();
SetClipboardData (CF_TEXT, clipdata);
CloseClipboard();
} else
GlobalFree (clipdata);
SendMessage (hwnd, WM_IGNORE_CLIP, FALSE, 0);
if (!must_deselect)
SendMessage (hwnd, WM_IGNORE_CLIP, FALSE, 0);
}
void get_clip (void **p, int *len) {