Skip to content

Commit

Permalink
Add EnumDesktopWindows && stuff (mhammond#2219)
Browse files Browse the repository at this point in the history
  • Loading branch information
CristiFati authored and clin1234 committed May 29, 2024
1 parent 2caf43b commit 86154e3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Coming in build 307, as yet unreleased
--------------------------------------

### pywin32
* Add EnumDesktopWindows (#2219, @CristiFati)
* Marked `exc_type` and `exc_traceback` in `win32comext.axscript.client.error.AXScriptException.__init__` as deprecated.
They are now unused and all information is taken from the `exc_value` parameter.
* Fixed non-overriden `pywin.scintilla.formatter.Formatter.ColorizeString` raising `TypeError` instead of `RuntimeError` due to too many parameters (#2216, @Avasam)
Expand Down
34 changes: 17 additions & 17 deletions win32/src/win32gui.i
Original file line number Diff line number Diff line change
Expand Up @@ -2003,23 +2003,23 @@ BOOL CALLBACK PyEnumWindowsProc(
HWND hwnd, // handle to parent window
LPARAM lParam // application-defined value
) {
BOOL result = TRUE;
PyEnumWindowsCallback *cb = (PyEnumWindowsCallback *)lParam;
CEnterLeavePython _celp;
PyObject *args = Py_BuildValue("(NO)", PyWinLong_FromHANDLE(hwnd), cb->extra);
if (args == NULL)
return FALSE;
PyObject *ret = PyObject_CallObject(cb->func, args);
Py_DECREF(args);
if (ret == NULL)
return FALSE;
if (ret != Py_None){
result = PyLong_AsLong(ret);
if (result == -1 && PyErr_Occurred())
result = FALSE;
}
Py_DECREF(ret);
return result;
BOOL result = TRUE;
PyEnumWindowsCallback *cb = (PyEnumWindowsCallback *)lParam;
CEnterLeavePython _celp;
PyObject *args = Py_BuildValue("(NO)", PyWinLong_FromHANDLE(hwnd), cb->extra);
if (args == NULL)
return FALSE;
PyObject *ret = PyObject_CallObject(cb->func, args);
Py_DECREF(args);
if (ret == NULL)
return FALSE;
if (ret != Py_None) {
result = PyLong_AsLong(ret);
if ((result == -1) && (PyErr_Occurred()))
result = FALSE;
}
Py_DECREF(ret);
return result;
}

// @pyswig |EnumWindows|Enumerates all top-level windows on the screen by passing the handle to each window, in turn, to an application-defined callback function.
Expand Down

0 comments on commit 86154e3

Please sign in to comment.