Esempio n. 1
0
        private static void Main()
        {
            var game = new Game();

            Settings.Default.SettingsLoaded += game.LoadSettings;

            WindowUtil.RefreshExplorer();

            game.Run(20);
        }
Esempio n. 2
0
        protected override void OnClosing(CancelEventArgs e)
        {
            Registry.SetValue(
                "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
                "ListviewAlphaSelect", 1);

            WindowUtil.ReloadWallpaper();
            WindowUtil.RefreshExplorer();

            base.OnClosing(e);
        }
Esempio n. 3
0
        private bool CanUpdate()
        {
            var b = true;

            if (_processExceptions.Count > 0)
            {
                Process[] processes = Process.GetProcesses(".");

                Parallel.ForEach(processes, p =>
                {
                    for (var index = 0; index < _processExceptions.Count; index++)
                    {
                        var exception = _processExceptions[index];

                        if (string.Equals(p.ProcessName.ToLower(), exception, StringComparison.OrdinalIgnoreCase))
                        {
                            b = false;
                        }
                    }

                    p.Dispose();
                });

                if (!b)
                {
                    return(false);
                }
            }

            W32.EnumWindows((tophandle, topparamhandle) =>
            {
                if (tophandle != IntPtr.Zero && tophandle != WindowInfo.Handle)
                {
                    var placement = WindowUtil.GetPlacement(tophandle);

                    if (placement.showCmd == WindowUtil.ShowWindowCommands.Maximized &&
                        _startScreen.Bounds.Contains(placement.rcNormalPosition.Location))
                    {
                        b = false;
                    }

                    return(true);
                }

                return(true);
            }, IntPtr.Zero);

            return(b);
        }
Esempio n. 4
0
        private void Chb_CheckedChanged(object sender, EventArgs e)
        {
            SaveSettings();

            if (sender == chbSelectionRect)
            {
                Task.Run(() =>
                {
                    Registry.SetValue(
                        "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
                        "ListviewAlphaSelect", Settings.Default.SelectionRect ? 0 : 1);

                    WindowUtil.RefreshExplorer();
                });
            }
        }
Esempio n. 5
0
        public void LoadSettings(object sender, EventArgs args)
        {
            if (Settings.Default.ProcessExceptions is StringCollection s)
            {
                _processExceptions = s;
            }

            TargetRenderFrequency = Settings.Default.FramerateLimit;

            if (!Settings.Default.SelectionRect)
            {
                Task.Run(() =>
                {
                    Registry.SetValue(
                        "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
                        "ListviewAlphaSelect", 0);

                    WindowUtil.RefreshExplorer();
                });
            }
        }