Example #1
0
        public static bool IsOwned(IntPtr owner, IntPtr hwnd, ref int level)
        {
            IntPtr ownerWindow = WindowNative.GetWindow(hwnd, ModalWindow.GwOwner);

            if (ownerWindow == IntPtr.Zero)
            {
                return(false);
            }

            if (ownerWindow == owner)
            {
                return(true);
            }

            level++;

            return(IsOwned(owner, ownerWindow, ref level));
        }