Example #1
0
        private SecondDisplayProcess TransformProcessForDisplay(Win32Window window)
        {
            SecondDisplayProcess result;

            result = CachedProcesses.Get(window.Handle.ToInt32());
            if (result != null)
            {
                return(result);
            }

            result = SecondDisplayProcess.FromHandle(window.Handle);
            if (result.Title.Length == 0 || result.Icon == null || string.IsNullOrEmpty(result.Path))
            {
                return(null);
            }

            return(CachedProcesses.Add(window.Handle.ToInt32(), result));
        }