From 0b1db49d64bd4f50bc5bbd8e456566c77d492e11 Mon Sep 17 00:00:00 2001 From: RadAd Date: Tue, 16 Jul 2019 13:49:10 +1000 Subject: Close frame on last child window close --- WinUtils.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'WinUtils.h') diff --git a/WinUtils.h b/WinUtils.h index da1a652..059d858 100644 --- a/WinUtils.h +++ b/WinUtils.h @@ -202,3 +202,17 @@ inline bool FindMenuPos(HMENU hBaseMenu, UINT myID, HMENU* pMenu, int* mpos) return false; } + +inline BOOL CALLBACK CountChildWindowsProc(HWND, LPARAM lParam) +{ + int* pCount = (int*) lParam; + ++(*pCount); + return TRUE; +} + +inline int CountChildWindows(HWND hWnd) +{ + int count = 0; + EnumChildWindows(hWnd, CountChildWindowsProc, (LPARAM) &count); + return count; +} -- cgit v1.2.3