Check the WS_CHILD bit:
LONG style = GetWindowLong(hwnd, GWL_STYLE); int isTopLevel = !(style & WS_CHILD);
Or is there a better way?
Suppose : direct C, calling only the existing Windows API code.
Path number 1: Test hWnd==GetAncestor(hWnd,GA_ROOT)
hWnd==GetAncestor(hWnd,GA_ROOT)
Method number 2: use IsTopLevelWindow (user32 Win7, undocumented)
IsTopLevelWindow
The GetParent () API returns the parent or owner of the current window.
Your method is possible (but I think you better check to see if it is too blocked / popup). Perhaps there is another way - to list all the top-level windows and check if your windows are included in the result.
Source: https://habr.com/ru/post/946735/More articles:The first top view / overlap of the second in LinearLayout - androidIDEA plugin: PersistentStateComponent not saved xml - javaServer-side sorting using Mongoose (mongodb + node.js) - collectionsKeep duplicates when using array_diff - arrayshow to get item index or number together with key, value in dict - pythonCGContextAddArc counterclockwise instead of clockwise - iosLINQ Line Provider? - c #Override bash chef return code - chefAutomatically add dashes to phone number in Android - androidCustomize layout (components) for activeadmin - ruby-on-railsAll Articles