diff options
Diffstat (limited to 'protocols/JabberG/src/jabber_util.cpp')
-rwxr-xr-x | protocols/JabberG/src/jabber_util.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index dceac9a0db..659d3b391f 100755 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -769,6 +769,23 @@ const wchar_t *JabberStrIStr(const wchar_t *str, const wchar_t *substr) ////////////////////////////////////////////////////////////////////////
// clipboard processing
+void JabberCopyText(HWND hwnd, const char *pszText)
+{
+ if (!hwnd || !pszText) return;
+
+ if (OpenClipboard(hwnd)) {
+ Utf2T text(pszText);
+
+ EmptyClipboard();
+ HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_wstrlen(text) + 1));
+ wchar_t *s = (wchar_t *)GlobalLock(hMem);
+ mir_wstrcpy(s, text);
+ GlobalUnlock(hMem);
+ SetClipboardData(CF_UNICODETEXT, hMem);
+ CloseClipboard();
+ }
+}
+
void JabberCopyText(HWND hwnd, const wchar_t *text)
{
if (!hwnd || !text) return;
|