From 456b5352d7b25a3e8af22aaf74ef38946e0c1294 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 27 Oct 2024 02:28:20 -0400 Subject: [PATCH] Remove unused hIcon param from PyShellExecuteEx --- CHANGES.txt | 1 + com/win32comext/shell/src/shell.cpp | 23 +++++------------------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 1ff2bf9f2..9fe91b1ee 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,6 +14,7 @@ https://mhammond.github.io/pywin32_installers.html. Coming in build 309, as yet unreleased -------------------------------------- +* Removed param `hIcon` from `win32comext.shell.ShellExecuteEx`. It was unusable since Windows Vista (#2423, @Avasam) * Fixed `ddeclient` and `ddeserver` demos import error (#2290, @Avasam) * The `EvtSubscribe_push` demo now actually demonstrates the callback action and the event context being filled. (#2281, @Avasam) * Fixed Pythonwin's editor failing due to invalid regex import (#2419, @Avasam) diff --git a/com/win32comext/shell/src/shell.cpp b/com/win32comext/shell/src/shell.cpp index b6d133734..8b3cbda11 100644 --- a/com/win32comext/shell/src/shell.cpp +++ b/com/win32comext/shell/src/shell.cpp @@ -2532,15 +2532,14 @@ static PyObject *PyShellExecuteEx(PyObject *self, PyObject *args, PyObject *kw) static char *kw_items[] = { "fMask", "hwnd", "lpVerb", "lpFile", "lpParameters", "lpDirectory", "nShow", - "lpIDList", "lpClass", "hkeyClass", "dwHotKey", "hIcon", "hMonitor", NULL, + "lpIDList", "lpClass", "hkeyClass", "dwHotKey", "hMonitor", NULL, }; PyObject *obhwnd = Py_None, *obVerb = NULL, *obFile = NULL, *obParams = NULL; PyObject *obDirectory = NULL, *obIDList = NULL, *obClass = 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, "|lOOOOOlOOOOOO", kw_items, &info.fMask, + PyObject *obhkeyClass = NULL, *obHotKey = NULL, *obhMonitor = NULL; + if (!PyArg_ParseTupleAndKeywords(args, kw, "|lOOOOOlOOOOO", kw_items, + &info.fMask, // @pyparm int|fMask|0|The default mask for the structure. + // Other masks may be added based on what paramaters are supplied. &obhwnd, // @pyparm |hwnd|0| &obVerb, // @pyparm string|lpVerb|| &obFile, // @pyparm string|lpFile|| @@ -2551,7 +2550,6 @@ 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)) @@ -2585,17 +2583,6 @@ 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))