summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_profile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tox/src/tox_profile.cpp')
-rw-r--r--protocols/Tox/src/tox_profile.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp
index a404d080ca..35014a4500 100644
--- a/protocols/Tox/src/tox_profile.cpp
+++ b/protocols/Tox/src/tox_profile.cpp
@@ -137,6 +137,22 @@ void CToxProto::SaveToxProfile()
mir_free(data);
}
+int CToxProto::OnCopyToxID(WPARAM, LPARAM)
+{
+ ptrA address(getStringA(TOX_SETTINGS_ID));
+ size_t length = mir_strlen(address) + 1;
+ if (OpenClipboard(NULL))
+ {
+ EmptyClipboard();
+ HGLOBAL hMem = GlobalAlloc(GMEM_FIXED, length);
+ memcpy(GlobalLock(hMem), address, length);
+ GlobalUnlock(hMem);
+ SetClipboardData(CF_TEXT, hMem);
+ CloseClipboard();
+ }
+ return 0;
+}
+
INT_PTR CToxProto::ToxProfilePasswordProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
CToxProto *proto = (CToxProto*)GetWindowLongPtr(hwnd, GWLP_USERDATA);