From eb956617f7e340d3f7871b799ba59a538d5d5ba8 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 27 Oct 2024 02:30:42 -0400 Subject: [PATCH] Discard changes to com/win32comext/shell/src/shell.cpp --- com/win32comext/shell/src/shell.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) 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))