Is it to check for the WS_CHILD bit:
LONG style = GetWindowLong(hwnd, GWL_STYLE);
int isTopLevel = !(style & WS_CHILD);
Or is there a better way?
Assume: Straight C calling only existing Windows API code.
Way #1: Test hWnd==GetAncestor(hWnd,GA_ROOT)
Way #2: Use IsTopLevelWindow
(user32 Win7, undocumented)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With