From c5dc28ec2272a865ef2f28fd7ab151b55517fedf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Sep 2022 19:16:12 +0300 Subject: more clipboard shit removed --- plugins/SendScreenshotPlus/src/CSend.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'plugins/SendScreenshotPlus/src') diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index f13760b7de..5a5e72e03e 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -162,23 +162,9 @@ INT_PTR CALLBACK CSend::ResultDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, memcpy(tmp + len, L"[/img][/url]", 13 * sizeof(wchar_t)); len += 12; } } - else - len = GetDlgItemText(hwndDlg, edtID, tmp, _countof(tmp)); - int retries = 3; - do { - if (!OpenClipboard(hwndDlg)) { - Sleep(100); - continue; - } - EmptyClipboard(); - HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE, len*sizeof(wchar_t) + sizeof(wchar_t)); - wchar_t* tmp2 = (wchar_t*)GlobalLock(clipbuffer); - mir_wstrncpy(tmp2, tmp, len + 1); tmp2[len] = '\0'; - GlobalUnlock(clipbuffer); - SetClipboardData(CF_UNICODETEXT, clipbuffer); - CloseClipboard(); - break; - } while (--retries); + else len = GetDlgItemText(hwndDlg, edtID, tmp, _countof(tmp)); + + Utils_ClipboardCopy(CMStringW(tmp, len + 1)); if (LOWORD(wParam) == IDOK) DestroyWindow(hwndDlg); -- cgit v1.2.3