aboutsummaryrefslogtreecommitdiff
path: root/WinUtils.h
diff options
context:
space:
mode:
authorRadAd <adamgates84+github@gmail.com>2019-07-16 13:49:10 +1000
committerRadAd <adamgates84+github@gmail.com>2019-07-16 13:49:10 +1000
commit0b1db49d64bd4f50bc5bbd8e456566c77d492e11 (patch)
tree02295853ce10833d72ca3b5cbd3aef193531e50c /WinUtils.h
parentb40b190dfdb50acd2cbb2108e92c3d4b0d7f3bfe (diff)
downloadRadTerminal-0b1db49d64bd4f50bc5bbd8e456566c77d492e11.tar.gz
RadTerminal-0b1db49d64bd4f50bc5bbd8e456566c77d492e11.zip
Close frame on last child window close
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;
+}