diff --git a/mypy.ini b/mypy.ini index 8afadd9af..5b4fb007a 100644 --- a/mypy.ini +++ b/mypy.ini @@ -27,7 +27,7 @@ disable_error_code = attr-defined, method-assign, name-defined exclude = .*((build|adodbapi|Pythonwin/Scintilla|Pythonwin/pywin/idle|[Tt]est|[Dd]emos?)/.*|rasutil.py|setup.py) ; C-modules that will need type-stubs -[mypy-adsi.*,dde,exchange,exchdapi,perfmon,servicemanager,win32api,win32clipboard,win32event,win32evtlog,win32file,win32gui,win32help,win32pdh,win32process,win32ras,win32security,win32service,win32trace,win32ui,win32uiole,win32wnet,wincerapi,_win32sysloader,_winxptheme] +[mypy-adsi.*,dde,exchange,exchdapi,perfmon,servicemanager,win32api,win32console,win32clipboard,win32event,win32evtlog,win32file,win32gui,win32help,win32pdh,win32process,win32ras,win32security,win32service,win32trace,win32ui,win32uiole,win32wnet,wincerapi,_win32sysloader,_winxptheme] ignore_missing_imports = True ; verstamp is installed from win32verstamp.py called in setup.py diff --git a/win32/src/win32gui.i b/win32/src/win32gui.i index cae2f0eb2..3e0811532 100644 --- a/win32/src/win32gui.i +++ b/win32/src/win32gui.i @@ -5659,6 +5659,12 @@ BOOLAPI SetWindowRgn( HRGN INPUT_NULLOK, // @pyparm |hRgn||Handle to region to be set, can be None BOOL Redraw); // @pyparm boolean|Redraw||Indicates if window should be completely redrawn +// @pyswig int, |GetWindowRgnBox|Returns the bounding box for a window's region +// @rdesc Returns type of region and rectangle coordinates in device units +int_regiontype GetWindowRgnBox( + HWND hWnd, // @pyparm |hWnd||Handle to a window that has a window region. (see ) + RECT *OUTPUT); + // @pyswig |ValidateRgn|Removes a region from a window's update region BOOLAPI ValidateRgn( HWND hWnd, // @pyparm |hWnd||Handle to the window diff --git a/win32/winxpgui.py b/win32/winxpgui.py index 6e2c1370c..5e9df42d3 100644 --- a/win32/winxpgui.py +++ b/win32/winxpgui.py @@ -1,15 +1,12 @@ +from __future__ import annotations + import warnings from win32console import GetConsoleWindow as GetConsoleWindow from win32gui import * -REGION_BOX = [0, (0, 0, 0, 0)] - warnings.warn( - "The `winxpgui` gui is deprecated and simply re-exports `win32gui.*`, `win32console.GetConsoleWindow`, " - + f"and `GetWindowRgnBox` is now hardcoded to return `{REGION_BOX}`.", + "The `winxpgui` module is obsolete and has been completely replaced " + "by `win32gui` and `win32console.GetConsoleWindow`. Use those instead.", category=DeprecationWarning, ) -def GetWindowRgnBox(__): - print(f"`GetWindowRgnBox` is no longer supported and will always return `{REGION_BOX}`.") - return REGION_BOX