summaryrefslogtreecommitdiff
path: root/plugins/MenuItemEx/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/MenuItemEx/src
parentdc2a4dc50d6cc3e7bd513122756dd39141d7887e (diff)
more clipboard shit removed
Diffstat (limited to 'plugins/MenuItemEx/src')
-rw-r--r--plugins/MenuItemEx/src/main.cpp28
1 files changed, 4 insertions, 24 deletions
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp
index a6cd043c2c..f30a2b9f97 100644
--- a/plugins/MenuItemEx/src/main.cpp
+++ b/plugins/MenuItemEx/src/main.cpp
@@ -212,26 +212,6 @@ BOOL DirectoryExists(MCONTACT hContact)
return (attr != -1) && (attr&FILE_ATTRIBUTE_DIRECTORY);
}
-void CopyToClipboard(const wchar_t *pwszMsg)
-{
- if (pwszMsg == nullptr)
- return;
-
- HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_wstrlen(pwszMsg) + 1) * sizeof(wchar_t));
- LPWSTR lptstrCopy = (LPWSTR)GlobalLock(hglbCopy);
- mir_wstrcpy(lptstrCopy, pwszMsg);
- GlobalUnlock(hglbCopy);
-
- if (OpenClipboard(nullptr) == NULL)
- return;
-
- EmptyClipboard();
-
- SetClipboardData(CF_UNICODETEXT, hglbCopy);
-
- CloseClipboard();
-}
-
BOOL isMetaContact(MCONTACT hContact)
{
char *proto = Proto_GetBaseAccountName(hContact);
@@ -479,7 +459,7 @@ static INT_PTR onCopyID(WPARAM hContact, LPARAM)
}
else buf = wszId;
- CopyToClipboard(buf);
+ Utils_ClipboardCopy(buf);
if (CTRL_IS_PRESSED)
ShowPopup(buf, hContact);
@@ -515,7 +495,7 @@ static INT_PTR onCopyStatusMsg(WPARAM hContact, LPARAM)
}
}
- CopyToClipboard(wszBuffer);
+ Utils_ClipboardCopy(wszBuffer);
if (CTRL_IS_PRESSED)
ShowPopup(wszBuffer, hContact);
@@ -535,7 +515,7 @@ static INT_PTR onCopyIP(WPARAM hContact, LPARAM)
if (rIP)
wszBuffer.AppendFormat(L"Internal IP: %d.%d.%d.%d\r\n", rIP >> 24, (rIP >> 16) & 0xFF, (rIP >> 8) & 0xFF, rIP & 0xFF);
- CopyToClipboard(wszBuffer);
+ Utils_ClipboardCopy(wszBuffer);
if (CTRL_IS_PRESSED)
ShowPopup(wszBuffer, hContact);
@@ -546,7 +526,7 @@ static INT_PTR onCopyMirVer(WPARAM hContact, LPARAM)
{
LPWSTR msg = getMirVer(hContact);
if (msg) {
- CopyToClipboard(msg);
+ Utils_ClipboardCopy(msg);
if (CTRL_IS_PRESSED)
ShowPopup(msg, hContact);