From 2bc65d993a2f6186a562502924c6300a22230c6f Mon Sep 17 00:00:00 2001 From: CristiFati Date: Mon, 15 Aug 2022 05:25:27 +0300 Subject: [PATCH 1/2] Add GetTopWindow --- win32/src/win32gui.i | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/win32/src/win32gui.i b/win32/src/win32gui.i index 26a0afaf7e..2c865a6309 100644 --- a/win32/src/win32gui.i +++ b/win32/src/win32gui.i @@ -5817,6 +5817,10 @@ HWND GetWindow( HWND hWnd, // @pyparm int|hWnd||handle to original window UINT uCmd // @pyparm int|uCmd||relationship flag ); +// @pyswig int|GetTopWindow|Examines the Z order of the child windows associated with the specified parent window and retrieves a handle to the child window at the top of the Z order. +HWND GetTopWindow( + HWND hWnd // @pyparm int|hWnd||handle to parent window +); // @pyswig int|GetWindowDC|returns the device context (DC) for the entire window, including title bar, menus, and scroll bars. HDC GetWindowDC( HWND hWnd // @pyparm int|hWnd||handle of window From a827f1edb8552e5a363628fe91030047aead7f2b Mon Sep 17 00:00:00 2001 From: CristiFati Date: Mon, 15 Aug 2022 05:59:05 +0300 Subject: [PATCH 2/2] Add GetAncestor --- win32/src/win32gui.i | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/win32/src/win32gui.i b/win32/src/win32gui.i index 2c865a6309..108f9144a1 100644 --- a/win32/src/win32gui.i +++ b/win32/src/win32gui.i @@ -5817,10 +5817,18 @@ HWND GetWindow( HWND hWnd, // @pyparm int|hWnd||handle to original window UINT uCmd // @pyparm int|uCmd||relationship flag ); + // @pyswig int|GetTopWindow|Examines the Z order of the child windows associated with the specified parent window and retrieves a handle to the child window at the top of the Z order. HWND GetTopWindow( HWND hWnd // @pyparm int|hWnd||handle to parent window ); + +// @pyswig int|GetAncestor|retrieves the handle to the ancestor of the specified window. +HWND GetAncestor( + HWND hWnd, // @pyparm int|hWnd||handle to original window + UINT gaFlags // @pyparm int|gaFlags||ancestor to be retrieved +); + // @pyswig int|GetWindowDC|returns the device context (DC) for the entire window, including title bar, menus, and scroll bars. HDC GetWindowDC( HWND hWnd // @pyparm int|hWnd||handle of window