Beispiel #1
0
        private static bool EnumWindowCallback(IntPtr hwnd, int lParam)
        {
            if ( /*hwnd != fExposéWindowHandle &&*/ (User32.GetWindowLongA(hwnd, VistaDwm.GWL_STYLE) & VistaDwm.WS_VISIBLE) == VistaDwm.WS_VISIBLE ) {
                User32.GetWindowText(hwnd, titleBuilder, titleBuilder.Capacity);

                if ( titleBuilder.ToString() == "Program Manager" || (User32.GetWindowLongA(hwnd, VistaDwm.GWL_STYLE) & VistaDwm.WS_VISIBLE) == VistaDwm.WS_VISIBLE ) {

                    VistaWindow window;
                    if ( cachedWindows.ContainsKey(hwnd) ) {
                        window = cachedWindows[hwnd];

                        // we are pulling cached window so let it update visible properties
                        window.RefreshVisibleProperties(titleBuilder.ToString());
                    } else {
                        window = new VistaWindow(hwnd, titleBuilder.ToString());
                        cachedWindows.Add(hwnd, window);
                    }

                    IntPtr parentHwnd = User32.GetParent(hwnd);
                    if ( window.Title.Length > 0 && IsValidTitle(window.Title) && parentHwnd == IntPtr.Zero ) {
                        windowList.Add(window);
                    }
                }
            }

            //continue enumeration
            return true;
        }
Beispiel #2
0
        public bool Accepts(VistaWindow window)
        {
            if ( this.fApplicationInstance == -1 ) {
                foreach ( string matchString in this.fMatchStrings ) {
                    if ( window.Title.Contains(matchString) ) {
                        return true;
                    }
                }
                return false;

            } else {
                return (window.ApplicationInstance == this.fApplicationInstance);
            }
        }
 public WindowPositionTransition(VistaWindow window, Rect start, Rect end)
 {
     this.fWindow = window;
     this.fStartRect = start;
     this.fEndRect = end;
 }
Beispiel #4
0
 public void AddWindow(VistaWindow window)
 {
     this.fWindows.Add(window);
 }