Example #1
0
        internal ThumbButton(ThumbButtonManager manager, int id, Icon icon, string tooltip)
        {
            _manager = manager;

            Id      = id;
            Icon    = icon;
            Tooltip = tooltip;
        }
Example #2
0
        internal ThumbButton(ThumbButtonManager manager, int id, Icon icon, string tooltip)
        {
            _manager = manager;

            Id = id;
            Icon = icon;
            Tooltip = tooltip;
        }
Example #3
0
 public HackerWindow()
 {
     Program.HackerWindow = this;
     processP = Program.ProcessProvider;
     serviceP = Program.ServiceProvider;
     networkP = Program.NetworkProvider;
     InitializeComponent();
     { var handle = this.Handle; }
     Program.HackerWindowHandle = this.Handle;
     if (OSVersion.HasExtendedTaskbar)
     {
         Windows7Taskbar.AllowWindowMessagesThroughUipi();
         Windows7Taskbar.AppId = "ProcessHacker";
         Windows7Taskbar.ProcessAppId = "ProcessHacker";
         thumbButtonManager = new ThumbButtonManager(this);
         thumbButtonManager.TaskbarButtonCreated += new EventHandler(thumbButtonManager_TaskbarButtonCreated);
     }
     this.AddEscapeToClose();
     Logging.Logged += this.QueueMessage;
     Settings.Refresh();
     this.LoadWindowSettings();
     this.LoadOtherSettings();
     this.LoadControls();
     this.LoadNotificationIcons();
     Program.AppInstance = new ApplicationInstance();
     Program.AppInstance.MainMenu = new MainMenuManager(mainMenu.MenuItems);
     Program.AppInstance.MainMenu.Hacker = new MenuItemManager(hackerMenuItem.MenuItems);
     Program.AppInstance.MainMenu.View = new MenuItemManager(viewMenuItem.MenuItems);
     Program.AppInstance.MainMenu.Tools = new MenuItemManager(toolsMenuItem.MenuItems);
     Program.AppInstance.MainMenu.Help = new MenuItemManager(helpMenu.MenuItems);
     this.LoadPlugins();
     if ((!Properties.Settings.Default.StartHidden && !Program.StartHidden) ||
         Program.StartVisible)
     {
         this.Visible = true;
     }
     if (tabControl.SelectedTab == tabProcesses)
         treeProcesses.Tree.Select();
     this.LoadOther();
     this.LoadStructs();
     vistaMenu.DelaySetImageCalls = false;
     vistaMenu.PerformPendingSetImageCalls();
     serviceP.RunOnceAsync();
     serviceP.Enabled = true;
     _dontCalculate = false;
 }
Example #4
0
        public HackerWindow()
        {
            InitializeComponent();

            // Force the handle to be created
            { var handle = this.Handle; }
            Program.HackerWindowHandle = this.Handle;

            if (OSVersion.HasExtendedTaskbar)
            {
                // We need to call this here or we don't receive the TaskbarButtonCreated message
                Windows7Taskbar.AllowWindowMessagesThroughUipi();
                Windows7Taskbar.AppId = "ProcessHacker";
                Windows7Taskbar.ProcessAppId = "ProcessHacker";

                thumbButtonManager = new ThumbButtonManager(this);
                thumbButtonManager.TaskbarButtonCreated += new EventHandler(thumbButtonManager_TaskbarButtonCreated);
            }

            this.AddEscapeToClose();

            // Initialize action syncs
            _enableNetworkProviderSync = new ActionSync(
                () =>
                {
                    Program.NetworkProvider.Enabled = true;
                    Program.NetworkProvider.Boost();
                }, 2);
            _refreshHighlightingSync = new ActionSync(
                () =>
                {
                    this.BeginInvoke(new Action(treeProcesses.RefreshItems), null);
                }, 2);

            Logging.Logged += this.QueueMessage;
            this.LoadWindowSettings();
            this.LoadOtherSettings();
            this.LoadControls();
            this.LoadNotificationIcons();

            if ((!Settings.Instance.StartHidden && !Program.StartHidden) ||
                Program.StartVisible)
            {
                this.Visible = true;
            }

            if (tabControl.SelectedTab == tabProcesses)
                treeProcesses.Tree.Select();

            this.LoadOther();
            this.LoadStructs();

            vistaMenu.DelaySetImageCalls = false;
            vistaMenu.PerformPendingSetImageCalls();

            Program.ServiceProvider.Enabled = true;
            Program.ServiceProvider.Boost();

            _dontCalculate = false;
        }
Example #5
0
 public MessageFilter(ThumbButtonManager manager)
 {
     _manager = manager;
 }
 public MessageFilter(ThumbButtonManager manager)
 {
     _manager = manager;
 }
        public HackerWindow()
        {
            InitializeComponent();

            if (OSVersion.HasExtendedTaskbar)
            {
                // We need to call this here or we don't receive the TaskbarButtonCreated message
                Windows7Taskbar.AllowWindowMessagesThroughUipi();
                Windows7Taskbar.AppId = "ProcessHacker";
                Windows7Taskbar.ProcessAppId = "ProcessHacker";

                thumbButtonManager = new ThumbButtonManager(this);
                thumbButtonManager.TaskbarButtonCreated += this.thumbButtonManager_TaskbarButtonCreated;
            }

            this.AddEscapeToClose();

            // Initialize action syncs
            _enableNetworkProviderSync = new ActionSync(
                () =>
                {
                    Program.NetworkProvider.Enabled = true;
                    Program.NetworkProvider.Boost();
                }, 2);

            _refreshHighlightingSync = new ActionSync(() => this.BeginInvoke(new MethodInvoker(this.treeProcesses.RefreshItems), null), 2);

            Logging.Logged += this.QueueMessage;
            this.LoadWindowSettings();
            this.LoadOtherSettings();
            this.LoadControls();
            this.LoadNotificationIcons();

            if ((!Settings.Instance.StartHidden && !Program.StartHidden) || Program.StartVisible)
            {
                this.Visible = true;
            }

            if (tabControl.SelectedTab == tabProcesses)
                treeProcesses.Tree.Select();

            this.LoadOther();
            this.LoadStructs();

            Program.ServiceProvider.Enabled = true;
            Program.ServiceProvider.Boost();

            ProcessHackerRestartRecovery.ApplicationRestartRecoveryManager.RegisterForRestart();
            //ProcessHackerRestartRecovery.ApplicationRestartRecoveryManager.RegisterForRecovery();

            this.CreateShutdownMenuItems();
            this.LoadFixOSSpecific();
            this.LoadUac();
            this.LoadAddShortcuts();
            this.LoadFixNProcessHacker();

            toolStrip.Items.Add(new ToolStripSeparator());
            var targetButton = new TargetWindowButton();
            targetButton.TargetWindowFound += (pid, tid) => this.SelectProcess(pid);
            toolStrip.Items.Add(targetButton);

            var targetThreadButton = new TargetWindowButton();
            targetThreadButton.TargetWindowFound += (pid, tid) => Program.GetProcessWindow(Program.ProcessProvider.Dictionary[pid], f =>
            {
                Program.FocusWindow(f);
                f.SelectThread(tid);
            });
            targetThreadButton.Image = Properties.Resources.application_go;
            targetThreadButton.Text = "Find window and select thread";
            targetThreadButton.ToolTipText = "Find window and select thread";
            toolStrip.Items.Add(targetThreadButton);

            try { TerminalServerHandle.RegisterNotificationsCurrent(this, true); }
            catch (Exception ex) { Logging.Log(ex); }
            try { this.UpdateSessions(); }
            catch (Exception ex) { Logging.Log(ex); }

            try { Win32.SetProcessShutdownParameters(0x100, 0); }
            catch { }

            if (Settings.Instance.AppUpdateAutomatic)
                this.UpdateProgram(false);

            ToolStripManager.Renderer = new AeroRenderer(ToolbarTheme.Blue);
        }