Split this out of #2183 (with additional improvements).
Notes:
To be merged after #2188 (although after that one is merged this will become invalid as it's on top of it (for testing purposes))!
Applied the same mechanism to all window enumeration functions. For EnumChildWindows, due to its special return value case, an exception will only be raised when callback raises one (when returning False and setting last error, no exception will be raised as in EnumWindows' case). Note that now it will raise the correct exception as until now in some cases it was (wrongly) raising: SystemError: <built-in function EnumChildWindows> returned a result with an exception set
Split this out of #2183 (with additional improvements).
Notes:
To be merged after #2188 (although after that one is merged this will become invalid as it's on top of it (for testing purposes))!
Applied the same mechanism to all window enumeration functions. For EnumChildWindows, due to its special return value case, an exception will only be raised when callback raises one (when returning False and setting last error, no exception will be raised as in EnumWindows' case). Note that now it will raise the correct exception as until now in some cases it was (wrongly) raising:
SystemError: <built-in function EnumChildWindows> returned a result with an exception set