Skip to content

Commit

Permalink
Remove unused hIcon param from PyShellExecuteEx
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Oct 27, 2024
1 parent 14df895 commit 456b535
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
23 changes: 5 additions & 18 deletions com/win32comext/shell/src/shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <o PyHANDLE>|hwnd|0|
&obVerb, // @pyparm string|lpVerb||
&obFile, // @pyparm string|lpFile||
Expand All @@ -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 <o PyHANDLE>|hIcon||
&obhMonitor)) // @pyparm <o PyHANDLE>|hMonitor||
goto done;
if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&info.hwnd))
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 456b535

Please sign in to comment.