Esempio n. 1
0
        private static bool GetKontextualItems(IntPtr hWnd, IntPtr lParam)
        {
            if (handlesToIgnore != null && handlesToIgnore.Contains(hWnd))
            {
                return true;
            }

            // Extract the window text
            var windowTextLength = GetWindowTextLength(hWnd);

            // If the window has title and visible - this is a legit kontext item
            if (windowTextLength > 0 && IsWindowVisible(hWnd) && !WindowsCache.ContainsKey(hWnd))
            {
                // Get the window title
                var strText = new StringBuilder(windowTextLength + 1);
                GetWindowText(hWnd, strText, windowTextLength + 1);

                // Create and cache a new item
                var newWindow = new VisualWindow(hWnd, strText.ToString());
                WindowsCache[hWnd] = newWindow;

                // Add to the result
                WindowsCache[hWnd] = newWindow;
            }

            return true;
        }
Esempio n. 2
0
 protected bool Equals(VisualWindow other)
 {
     return _hWnd.Equals(other._hWnd);
 }