From e39a0d8ea79a50de094811ce9adf110252aa7f31 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Thu, 21 Jan 2016 12:45:04 +0000 Subject: IEView: win32_ShellExecute javascript function git-svn-id: http://svn.miranda-ng.org/main/trunk@16134 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/IEView/src/external_funcs.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'plugins/IEView/src/external_funcs.cpp') 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; } -- cgit v1.2.3