Skip to content

Commit dbd9192

Browse files
authored
Remove unused hIcon param from PyShellExecuteEx (#2423)
1 parent 44de287 commit dbd9192

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ https://mhammond.github.io/pywin32_installers.html.
1414
Coming in build 309, as yet unreleased
1515
--------------------------------------
1616

17+
* Removed param `hIcon` from `win32comext.shell.ShellExecuteEx`. It was unusable since Windows Vista (#2423, @Avasam)
1718
* Fixed `nbios.NCBStruct` packing (#2406, @Avasam)
1819
* Restored axdebug builds on Python 3.10 (#2416, @Avasam)
1920
* Pythonwin: Bumped Scintilla from 1.77 to 4.4.6. The full changelog can be found here: https://www.scintilla.org/ScintillaHistory.html

com/win32comext/shell/src/shell.cpp

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2532,15 +2532,14 @@ static PyObject *PyShellExecuteEx(PyObject *self, PyObject *args, PyObject *kw)
25322532

25332533
static char *kw_items[] = {
25342534
"fMask", "hwnd", "lpVerb", "lpFile", "lpParameters", "lpDirectory", "nShow",
2535-
"lpIDList", "lpClass", "hkeyClass", "dwHotKey", "hIcon", "hMonitor", NULL,
2535+
"lpIDList", "lpClass", "hkeyClass", "dwHotKey", "hMonitor", NULL,
25362536
};
25372537
PyObject *obhwnd = Py_None, *obVerb = NULL, *obFile = NULL, *obParams = NULL;
25382538
PyObject *obDirectory = NULL, *obIDList = NULL, *obClass = NULL;
2539-
PyObject *obhkeyClass = NULL, *obHotKey = NULL, *obhIcon = NULL;
2540-
PyObject *obhMonitor = NULL;
2541-
// @pyparm int|fMask|0|The default mask for the structure. Other
2542-
// masks may be added based on what paramaters are supplied.
2543-
if (!PyArg_ParseTupleAndKeywords(args, kw, "|lOOOOOlOOOOOO", kw_items, &info.fMask,
2539+
PyObject *obhkeyClass = NULL, *obHotKey = NULL, *obhMonitor = NULL;
2540+
if (!PyArg_ParseTupleAndKeywords(args, kw, "|lOOOOOlOOOOO", kw_items,
2541+
&info.fMask, // @pyparm int|fMask|0|The default mask for the structure.
2542+
// Other masks may be added based on what paramaters are supplied.
25442543
&obhwnd, // @pyparm <o PyHANDLE>|hwnd|0|
25452544
&obVerb, // @pyparm string|lpVerb||
25462545
&obFile, // @pyparm string|lpFile||
@@ -2551,7 +2550,6 @@ static PyObject *PyShellExecuteEx(PyObject *self, PyObject *args, PyObject *kw)
25512550
&obClass, // @pyparm string|obClass||
25522551
&obhkeyClass, // @pyparm int|hkeyClass||
25532552
&obHotKey, // @pyparm int|dwHotKey||
2554-
&obhIcon, // @pyparm <o PyHANDLE>|hIcon||
25552553
&obhMonitor)) // @pyparm <o PyHANDLE>|hMonitor||
25562554
goto done;
25572555
if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&info.hwnd))
@@ -2585,17 +2583,6 @@ static PyObject *PyShellExecuteEx(PyObject *self, PyObject *args, PyObject *kw)
25852583
if (PyErr_Occurred())
25862584
goto done;
25872585
}
2588-
if (obhIcon) {
2589-
// SEE_MASK_ICON is defined around 'if (NTDDI_VERSION < NTDDI_LONGHORN)' and commented as 'not used'
2590-
#ifndef SEE_MASK_ICON
2591-
PyErr_SetString(PyExc_NotImplementedError, "SEE_MASK_ICON not declared on this platform");
2592-
goto done;
2593-
#else
2594-
info.fMask |= SEE_MASK_ICON;
2595-
if (!PyWinObject_AsHANDLE(obhIcon, &info.hIcon))
2596-
goto done;
2597-
#endif
2598-
}
25992586
if (obhMonitor) {
26002587
info.fMask |= SEE_MASK_HMONITOR;
26012588
if (!PyWinObject_AsHANDLE(obhMonitor, &info.hMonitor))

0 commit comments

Comments
 (0)