Exemplo n.º 1
0
        void Update(IntPtr handle)
        {
            var prevHandle = Handle;

            if (prevHandle != handle)
            {
                (var process, var path) = WindowUtility.GetProcessAndPath(handle);

                this.handle  = handle;
                this.path    = path;
                this.process = process;
                classname    = WindowUtility.GetClassname(handle);

                isUWP = WindowUtility.IsUWPWindow(handle);
                UpdateIcon(updateUWP: true);
                UpdateTitle();
                UpdateRect();
                UpdateScreen();
                (preview as IDisposable)?.Dispose();
                preview = new Preview(handle);

                OnPropertyChanged(nameof(Handle));
                OnPropertyChanged(nameof(ProcessPath));
                OnPropertyChanged(nameof(Process));
                OnPropertyChanged(nameof(IsUWP));
                OnPropertyChanged(nameof(Classname));
            }

            base.Update();

            if (prevHandle != handle)
            {
                RaiseActiveWindowChanged();
            }
        }
Exemplo n.º 2
0
 public override void Update() =>
 Update(WindowUtility.GetActiveWindow());