summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/WhatsApp/src/proto.cpp2
-rw-r--r--protocols/WhatsApp/src/utils.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp
index f3400a94f4..a5384be1c6 100644
--- a/protocols/WhatsApp/src/proto.cpp
+++ b/protocols/WhatsApp/src/proto.cpp
@@ -408,7 +408,7 @@ void WhatsAppProto::NotifyEvent(const TCHAR *title, const TCHAR *info, MCONTACT
pd.lchContact = contact;
pd.lchIcon = IcoLib_GetIconByHandle(m_hProtoIcon); // TODO: Icon test
pd.PluginData = szUrl;
- pd.PluginWindowProc = (WNDPROC)PopupDlgProc;
+ pd.PluginWindowProc = PopupDlgProc;
mir_tstrcpy(pd.lptzContactName, title);
mir_tstrcpy(pd.lptzText, info);
ret = PUAddPopupT(&pd);
diff --git a/protocols/WhatsApp/src/utils.cpp b/protocols/WhatsApp/src/utils.cpp
index 4458f976f0..946e581bbd 100644
--- a/protocols/WhatsApp/src/utils.cpp
+++ b/protocols/WhatsApp/src/utils.cpp
@@ -14,7 +14,9 @@ void utils::copyText(HWND hwnd, const TCHAR *text)
{
if (!hwnd || !text) return;
- OpenClipboard(hwnd);
+ if (!OpenClipboard(hwnd))
+ return;
+
EmptyClipboard();
HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(text) + 1));
mir_tstrcpy((TCHAR*)GlobalLock(hMem), text);