diff options
author | RadAd <adamgates84+github@gmail.com> | 2019-07-16 13:49:10 +1000 |
---|---|---|
committer | RadAd <adamgates84+github@gmail.com> | 2019-07-16 13:49:10 +1000 |
commit | 0b1db49d64bd4f50bc5bbd8e456566c77d492e11 (patch) | |
tree | 02295853ce10833d72ca3b5cbd3aef193531e50c /WinUtils.h | |
parent | b40b190dfdb50acd2cbb2108e92c3d4b0d7f3bfe (diff) | |
download | RadTerminal-0b1db49d64bd4f50bc5bbd8e456566c77d492e11.tar.gz RadTerminal-0b1db49d64bd4f50bc5bbd8e456566c77d492e11.zip |
Close frame on last child window close
Diffstat (limited to 'WinUtils.h')
-rw-r--r-- | WinUtils.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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; +} |