Пример #1
0
        public void SetCategory()
        {
            string category;

            if (_applicationInfo != null && _applicationInfo.Category == null)
            {
                // if app was removed, category is null, so stop using that app
                _applicationInfo.PropertyChanged -= AppInfo_PropertyChanged;
                _applicationInfo = null;
            }
            category = ApplicationInfo?.Category?.DisplayName;

            if (category == null && WinFileName.ToLower().Contains("cairodesktop.exe"))
            {
                category = "Cairo";
            }
            else if (category == null && WinFileName.ToLower().Contains("\\windows\\") && !isUWP)
            {
                category = "Windows";
            }
            else if (category == null)
            {
                category = Localization.DisplayString.sAppGrabber_Uncategorized;
            }

            if (_category != category)
            {
                _category = category;
                OnPropertyChanged("Category");
            }
        }
Пример #2
0
        public string GetCategory(ApplicationWindow window)
        {
            var category = GetCategoryDisplayName(window);

            switch (category)
            {
            case null when window.WinFileName.ToLower().Contains("cairodesktop.exe"):
                category = "Cairo";

                break;

            case null when window.WinFileName.ToLower().Contains("\\windows\\") && !window.IsUWP:
                category = "Windows";

                break;

            case null:
                category = Localization.DisplayString.sAppGrabber_Uncategorized;
                break;
            }

            return(category);
        }
Пример #3
0
        private bool getShowInTaskbar()
        {
            // EnumWindows and ShellHook return UWP app windows that are 'cloaked', which should not be visible in the taskbar.
            if (EnvironmentHelper.IsWindows8OrBetter)
            {
                int cbSize = Marshal.SizeOf(typeof(uint));
                NativeMethods.DwmGetWindowAttribute(Handle, NativeMethods.DWMWINDOWATTRIBUTE.DWMWA_CLOAKED, out var cloaked, cbSize);

                if (cloaked > 0)
                {
                    ShellLogger.Debug($"ApplicationWindow: Cloaked ({cloaked}) window ({Title}) hidden from taskbar");
                    return(false);
                }

                // UWP shell windows that are not cloaked should be hidden from the taskbar, too.
                StringBuilder cName = new StringBuilder(256);
                NativeMethods.GetClassName(Handle, cName, cName.Capacity);
                string className = cName.ToString();
                if (className == "ApplicationFrameWindow" || className == "Windows.UI.Core.CoreWindow")
                {
                    if ((ExtendedWindowStyles & (int)NativeMethods.ExtendedWindowStyles.WS_EX_WINDOWEDGE) == 0)
                    {
                        ShellLogger.Debug($"ApplicationWindow: Hiding UWP non-window {Title}");
                        return(false);
                    }
                }
                else if (!EnvironmentHelper.IsWindows10OrBetter && (className == "ImmersiveBackgroundWindow" || className == "SearchPane" || className == "NativeHWNDHost" || className == "Shell_CharmWindow" || className == "ImmersiveLauncher") && WinFileName.ToLower().Contains("explorer.exe"))
                {
                    ShellLogger.Debug($"ApplicationWindow: Hiding immersive shell window {Title}");
                    return(false);
                }
            }

            return(CanAddToTaskbar);
        }