Пример #1
0
        private void InitializeWindow()
        {
            ActionPerformed();
            Rect bounds = Desktop.Instance.Bounds;

            if (!bounds.Contains(Bounds) && (TitleBar != null && TitleBar.MinimizeButton != null))
            {
                Logger.WarnFormat(
                    @"Window with title: {0} whose dimensions are: {1}, is not contained completely on the desktop {2}. 
UI actions on window needing mouse would not work in area not falling under the desktop",
                    Title, Bounds, bounds);
            }
            WindowSession.Register(this);
        }
Пример #2
0
        private void InitializeWindow()
        {
            ActionPerformed();
            Rect bounds = Desktop.Instance.Bounds;

            if (!bounds.Contains(Bounds) && (TitleBar != null && TitleBar.MinimizeButton != null))
            {
                Logger.WarnFormat(
                    @"Window with title: {0} whose dimensions are: {1}, is not contained completely on the desktop {2}. 
UI actions on window needing mouse would not work in area not falling under the desktop",
                    Title, Bounds, bounds);
            }
            WindowSession.Register(this);

            var hwnd = new IntPtr(automationElement.Current.NativeWindowHandle);
            int ownerProcessId;

            ownerThreadId = NativeWindow.GetWindowThreadProcessId(hwnd, out ownerProcessId);
            ownerProcess  = Process.GetProcessById(ownerProcessId);
        }