diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-01-21 12:45:04 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-01-21 12:45:04 +0000 |
commit | e39a0d8ea79a50de094811ce9adf110252aa7f31 (patch) | |
tree | 58d17502458349e1f98681a2fbd7e0842a4db244 /plugins | |
parent | 24ea1df858fd00ce91c4bc8c06a71c50d03791cf (diff) |
IEView: win32_ShellExecute javascript function
git-svn-id: http://svn.miranda-ng.org/main/trunk@16134 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/IEView/src/IEView.cpp | 7 | ||||
-rw-r--r-- | plugins/IEView/src/external_funcs.cpp | 13 | ||||
-rw-r--r-- | plugins/IEView/src/external_funcs.h | 5 |
3 files changed, 21 insertions, 4 deletions
diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp index 3b92ddf519..9ceca7c676 100644 --- a/plugins/IEView/src/IEView.cpp +++ b/plugins/IEView/src/IEView.cpp @@ -414,7 +414,7 @@ STDMETHODIMP_(ULONG) IEView::Release(void) STDMETHODIMP IEView::GetTypeInfoCount(UINT *pctinfo)
{
if (pctinfo == NULL) return E_INVALIDARG;
- *pctinfo = 1;
+ *pctinfo = 2;
return S_OK;
}
STDMETHODIMP IEView::GetTypeInfo(UINT, LCID, LPTYPEINFO*)
@@ -428,6 +428,9 @@ STDMETHODIMP IEView::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames {
if (!wcscmp(L"db_get", rgszNames[i]))
rgDispId[i] = DISPID_EXTERNAL_DB_GET;
+ else if (!wcscmp(L"win32_ShellExecute", rgszNames[i]))
+ rgDispId[i] = DISPID_EXTERNAL_WIN32_SHELL_EXECUTE;
+
else
{
rgDispId[i] = NULL;
@@ -451,6 +454,8 @@ STDMETHODIMP IEView::Invoke(DISPID dispIdMember, {
case DISPID_EXTERNAL_DB_GET:
return External::db_get(pDispParams, pVarResult);
+ case DISPID_EXTERNAL_WIN32_SHELL_EXECUTE:
+ return External::win32_ShellExecute(pDispParams, pVarResult);
}
return DISP_E_MEMBERNOTFOUND;
diff --git a/plugins/IEView/src/external_funcs.cpp b/plugins/IEView/src/external_funcs.cpp index 34c2ff5dad..445c2e5df1 100644 --- a/plugins/IEView/src/external_funcs.cpp +++ b/plugins/IEView/src/external_funcs.cpp @@ -42,8 +42,19 @@ namespace External return S_OK;
}
- HRESULT ShellExec(DISPPARAMS *pDispParams, VARIANT *pVarResult)
+ HRESULT win32_ShellExecute(DISPPARAMS *pDispParams, VARIANT *pVarResult)
{
+ if (pDispParams->cArgs < 5 || pDispParams == nullptr)
+ return E_INVALIDARG;
+
+ HINSTANCE res = ShellExecuteW(NULL, pDispParams->rgvarg[4].bstrVal, pDispParams->rgvarg[3].bstrVal, pDispParams->rgvarg[2].bstrVal, pDispParams->rgvarg[1].bstrVal, pDispParams->rgvarg[0].intVal);
+
+ if (pVarResult != nullptr)
+ {
+ pVarResult->vt = VT_HANDLE;
+ pVarResult->ullVal = (ULONGLONG)res;
+ }
+
return S_OK;
}
diff --git a/plugins/IEView/src/external_funcs.h b/plugins/IEView/src/external_funcs.h index 7a693198a7..6b46424d35 100644 --- a/plugins/IEView/src/external_funcs.h +++ b/plugins/IEView/src/external_funcs.h @@ -1,10 +1,11 @@ enum EXTERNAL_FUNCTIONS
{
- DISPID_EXTERNAL_DB_GET = 652
+ DISPID_EXTERNAL_DB_GET = 652,
+ DISPID_EXTERNAL_WIN32_SHELL_EXECUTE
};
namespace External
{
HRESULT db_get(DISPPARAMS *pDispParams, VARIANT *pVarResult);
- HRESULT ShellExec(DISPPARAMS *pDispParams, VARIANT *pVarResult);
+ HRESULT win32_ShellExecute(DISPPARAMS *pDispParams, VARIANT *pVarResult);
}
\ No newline at end of file |