diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-01-22 16:33:28 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-01-22 16:33:28 +0000 |
commit | 4bb8550d10c34780632b8f3336d088f9745cfb94 (patch) | |
tree | 6307ed3cb9a09accf34dd4c3f52a22509354b8ed /plugins/IEView/src/external_funcs.cpp | |
parent | a5e8121ff0cfcbf7b716afd487759747fb801163 (diff) |
git-svn-id: http://svn.miranda-ng.org/main/trunk@16145 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src/external_funcs.cpp')
-rw-r--r-- | plugins/IEView/src/external_funcs.cpp | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/plugins/IEView/src/external_funcs.cpp b/plugins/IEView/src/external_funcs.cpp index 3032cda757..b7150ff3c9 100644 --- a/plugins/IEView/src/external_funcs.cpp +++ b/plugins/IEView/src/external_funcs.cpp @@ -40,8 +40,8 @@ namespace External if (pVarResult != nullptr)
{
- pVarResult->vt = VT_INT_PTR;
- pVarResult->ullVal = (ULONGLONG)res;
+ pVarResult->vt = VT_UINT;
+ pVarResult->uintVal = (UINT)res;
}
return S_OK;
}
@@ -151,8 +151,8 @@ namespace External if (pVarResult != nullptr)
{
- pVarResult->vt = VT_INT_PTR;
- pVarResult->ullVal = (ULONGLONG)res;
+ pVarResult->vt = VT_INT;
+ pVarResult->intVal = (int)res;
}
return S_OK;
}
@@ -173,4 +173,30 @@ namespace External return S_OK;
}
+ HRESULT win32_CopyToClipboard(DISPPARAMS *pDispParams, VARIANT *pVarResult)
+ {
+ if (pDispParams == nullptr || pDispParams->cArgs < 1)
+ return E_INVALIDARG;
+
+ BSTR data = pDispParams->rgvarg[0].bstrVal;
+ if (OpenClipboard(NULL))
+ {
+ EmptyClipboard();
+ size_t size = sizeof(TCHAR)* (mir_wstrlen(data) + 1);
+ HGLOBAL hClipboardData = GlobalAlloc(0, size);
+ if (hClipboardData)
+ {
+ TCHAR *pchData = (TCHAR*)GlobalLock(hClipboardData);
+ if (pchData)
+ {
+ memcpy(pchData, (TCHAR*)data, size);
+ GlobalUnlock(hClipboardData);
+ SetClipboardData(CF_UNICODETEXT, hClipboardData);
+ }
+ }
+ CloseClipboard();
+ }
+ return S_OK;
+ }
+
}
\ No newline at end of file |