From c5dc28ec2272a865ef2f28fd7ab151b55517fedf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Sep 2022 19:16:12 +0300 Subject: more clipboard shit removed --- plugins/SecureIM/src/commonheaders.cpp | 14 -------------- plugins/SecureIM/src/commonheaders.h | 1 - plugins/SecureIM/src/options.cpp | 6 +++--- 3 files changed, 3 insertions(+), 18 deletions(-) (limited to 'plugins/SecureIM/src') diff --git a/plugins/SecureIM/src/commonheaders.cpp b/plugins/SecureIM/src/commonheaders.cpp index 8355b59a75..db6b01fe01 100644 --- a/plugins/SecureIM/src/commonheaders.cpp +++ b/plugins/SecureIM/src/commonheaders.cpp @@ -80,20 +80,6 @@ int msgbox(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType) return r; } -void CopyToClipboard(HWND hwnd, LPSTR msg) -{ - HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, mir_strlen(msg) + 1); - LPSTR lpstrCopy = (LPSTR)GlobalLock(hglbCopy); - mir_strcpy(lpstrCopy, msg); - GlobalUnlock(hglbCopy); - - if(OpenClipboard(nullptr)) { - EmptyClipboard(); - SetClipboardData(CF_TEXT, hglbCopy); - CloseClipboard(); - } -} - HNETLIBUSER hNetlibUser; void InitNetlib() diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h index 50c84cf18b..60839f80b7 100644 --- a/plugins/SecureIM/src/commonheaders.h +++ b/plugins/SecureIM/src/commonheaders.h @@ -103,7 +103,6 @@ void GetFlags(); void SetFlags(); int msgbox(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType); -void CopyToClipboard(HWND hwnd,LPSTR msg); #endif diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index f2917aeeb3..a04e991ea7 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -1041,9 +1041,9 @@ static INT_PTR CALLBACK DlgProcOptionsProto(HWND hDlg, UINT wMsg, WPARAM wParam, case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_RSA_COPY: - char txt[128]; - GetDlgItemText(hDlg, IDC_RSA_SHA, txt, _countof(txt)); - CopyToClipboard(hDlg, txt); + wchar_t txt[128]; + GetDlgItemTextW(hDlg, IDC_RSA_SHA, txt, _countof(txt)); + Utils_ClipboardCopy(txt); return TRUE; case IDC_RSA_EXP: -- cgit v1.2.3