aboutsummaryrefslogtreecommitdiff
path: root/WinUtils.h
diff options
context:
space:
mode:
Diffstat (limited to 'WinUtils.h')
-rw-r--r--WinUtils.h14
1 files changed, 14 insertions, 0 deletions
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;
+}