summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-09-26 19:16:12 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-09-26 19:16:12 +0300
commitc5dc28ec2272a865ef2f28fd7ab151b55517fedf (patch)
treed751f3e869c66371b8f1d65480b39c2997ba6e62 /plugins/SendScreenshotPlus/src
parentdc2a4dc50d6cc3e7bd513122756dd39141d7887e (diff)
more clipboard shit removed
Diffstat (limited to 'plugins/SendScreenshotPlus/src')
-rw-r--r--plugins/SendScreenshotPlus/src/CSend.cpp20
1 files changed, 3 insertions, 17 deletions
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);