diff --git a/com/win32comext/shell/src/shell.cpp b/com/win32comext/shell/src/shell.cpp index 07eb7bf9c..b6d133734 100644 --- a/com/win32comext/shell/src/shell.cpp +++ b/com/win32comext/shell/src/shell.cpp @@ -2532,15 +2532,15 @@ static PyObject *PyShellExecuteEx(PyObject *self, PyObject *args, PyObject *kw) static char *kw_items[] = { "fMask", "hwnd", "lpVerb", "lpFile", "lpParameters", "lpDirectory", "nShow", - "lpIDList", "lpClass", "hkeyClass", "dwHotKey", "hMonitor", NULL, + "lpIDList", "lpClass", "hkeyClass", "dwHotKey", "hIcon", "hMonitor", NULL, }; PyObject *obhwnd = Py_None, *obVerb = NULL, *obFile = NULL, *obParams = NULL; PyObject *obDirectory = NULL, *obIDList = NULL, *obClass = NULL; - PyObject *obhkeyClass = NULL, *obHotKey = NULL, PyObject *obhMonitor = NULL; + PyObject *obhkeyClass = NULL, *obHotKey = NULL, *obhIcon = NULL; + PyObject *obhMonitor = NULL; // @pyparm int|fMask|0|The default mask for the structure. Other // masks may be added based on what paramaters are supplied. - if (!PyArg_ParseTupleAndKeywords(args, kw, "|lOOOOOlOOOOO", kw_items, - &info.fMask, // @pyparm int|fMask|0| + if (!PyArg_ParseTupleAndKeywords(args, kw, "|lOOOOOlOOOOOO", kw_items, &info.fMask, &obhwnd, // @pyparm |hwnd|0| &obVerb, // @pyparm string|lpVerb|| &obFile, // @pyparm string|lpFile|| @@ -2551,6 +2551,7 @@ static PyObject *PyShellExecuteEx(PyObject *self, PyObject *args, PyObject *kw) &obClass, // @pyparm string|obClass|| &obhkeyClass, // @pyparm int|hkeyClass|| &obHotKey, // @pyparm int|dwHotKey|| + &obhIcon, // @pyparm |hIcon|| &obhMonitor)) // @pyparm |hMonitor|| goto done; if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&info.hwnd)) @@ -2584,6 +2585,17 @@ static PyObject *PyShellExecuteEx(PyObject *self, PyObject *args, PyObject *kw) if (PyErr_Occurred()) goto done; } + if (obhIcon) { +// SEE_MASK_ICON is defined around 'if (NTDDI_VERSION < NTDDI_LONGHORN)' and commented as 'not used' +#ifndef SEE_MASK_ICON + PyErr_SetString(PyExc_NotImplementedError, "SEE_MASK_ICON not declared on this platform"); + goto done; +#else + info.fMask |= SEE_MASK_ICON; + if (!PyWinObject_AsHANDLE(obhIcon, &info.hIcon)) + goto done; +#endif + } if (obhMonitor) { info.fMask |= SEE_MASK_HMONITOR; if (!PyWinObject_AsHANDLE(obhMonitor, &info.hMonitor))