diff options
author | George Hazan <george.hazan@gmail.com> | 2015-02-06 23:36:02 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-02-06 23:36:02 +0000 |
commit | b2f86045d3b3dc2a454f127f186429b60e493072 (patch) | |
tree | f56c5696ef3ebf62b1a97e4abbfcbc332adbbd28 /protocols/WhatsApp/src/utils.cpp | |
parent | 8c6ce1ceb218db86d059372e18277c16b1ab20cb (diff) |
merge from branch
git-svn-id: http://svn.miranda-ng.org/main/trunk@12029 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/utils.cpp')
-rw-r--r-- | protocols/WhatsApp/src/utils.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/protocols/WhatsApp/src/utils.cpp b/protocols/WhatsApp/src/utils.cpp index 2b9ebd2b2f..652a9c7c4a 100644 --- a/protocols/WhatsApp/src/utils.cpp +++ b/protocols/WhatsApp/src/utils.cpp @@ -1,8 +1,26 @@ #include "common.h"
-LONG WhatsAppProto::GetSerial()
+TCHAR* utils::removeA(TCHAR *str)
{
- return ::_InterlockedIncrement(&m_iSerial);
+ if (str == NULL)
+ return NULL;
+
+ TCHAR *p = _tcschr(str, '@');
+ if (p) *p = 0;
+ return str;
+}
+
+void utils::copyText(HWND hwnd, const TCHAR *text)
+{
+ if (!hwnd || !text) return;
+
+ OpenClipboard(hwnd);
+ EmptyClipboard();
+ HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(text) + 1));
+ mir_tstrcpy((TCHAR*)GlobalLock(hMem), text);
+ GlobalUnlock(hMem);
+ SetClipboardData(CF_UNICODETEXT, hMem);
+ CloseClipboard();
}
std::string getLastErrorMsg()
|