diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-08-20 18:08:33 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-08-20 18:08:33 +0000 |
commit | 8c4e9632602b62e7484fab3a741bbc1daa33c412 (patch) | |
tree | 790981216251ae76f88725c7e01c2a5f3661f029 /protocols/Tox/src/tox_options.cpp | |
parent | 65939a1b4d4ab134b3d040c70eb47f11d509a5f6 (diff) |
Tox: - added own Tox ID in options dialog
git-svn-id: http://svn.miranda-ng.org/main/trunk@10243 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_options.cpp')
-rw-r--r-- | protocols/Tox/src/tox_options.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index ddbed584a6..e048769ce1 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -15,6 +15,9 @@ INT_PTR CALLBACK CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, ptrW nick(proto->getTStringA("Nick"));
SetDlgItemText(hwnd, IDC_NAME, nick);
+ ptrA toxId(proto->getStringA(TOX_SETTINGS_ID));
+ SetDlgItemTextA(hwnd, IDC_TOXID, toxId);
+
ptrW group(proto->getTStringA(TOX_SETTINGS_GROUP));
SetDlgItemText(hwnd, IDC_GROUP, group);
SendDlgItemMessage(hwnd, IDC_GROUP, EM_LIMITTEXT, 64, 0);
@@ -36,6 +39,22 @@ INT_PTR CALLBACK CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, }
break;
+ case IDC_CLIPBOARD:
+ {
+ char toxId[TOX_FRIEND_ADDRESS_SIZE * 2 + 1];
+ GetDlgItemTextA(hwnd, IDC_TOXID, toxId, SIZEOF(toxId));
+ if (OpenClipboard(GetDlgItem(hwnd, IDC_TOXID)))
+ {
+ EmptyClipboard();
+ HGLOBAL hMem = GlobalAlloc(GMEM_FIXED, SIZEOF(toxId));
+ memcpy(GlobalLock(hMem), toxId, SIZEOF(toxId));
+ GlobalUnlock(hMem);
+ SetClipboardData(CF_TEXT, hMem);
+ CloseClipboard();
+ }
+ }
+ break;
+
case IDC_GROUP:
if ((HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
return 0;
|