예제 #1
0
        private void InitializeSubControls()
        {
            var processStats = new ProcessStatistics(_pid);
            processStats.Dock = DockStyle.Fill;
            tabStatistics.Controls.Add(processStats);
            _processStats = processStats;

            // If this is a non-process, we need to clear the statistics first.
            if (_pid <= 0)
                _processStats.ClearStatistics();

            try
            {
                _tokenProps = new TokenProperties(new ProcessHandle(_pid, Program.MinProcessQueryRights));
                _tokenProps.Dock = DockStyle.Fill;
                tabToken.Controls.Add(_tokenProps);
            }
            catch
            { }

            try
            {
                using (var phandle = new ProcessHandle(_pid, Program.MinProcessQueryRights))
                {
                    var jhandle = phandle.GetJobObject(JobObjectAccess.Query);

                    if (jhandle != null)
                    {
                        using (jhandle)
                        {
                            _jobProps = new JobProperties(jhandle);
                            _jobProps.Dock = DockStyle.Fill;
                            tabJob.Controls.Add(_jobProps);
                        }
                    }
                }
            }
            catch
            { }

            if (Program.HackerWindow != null)
            {
                if (Program.HackerWindow.ProcessServices.ContainsKey(_pid))
                {
                    if (Program.HackerWindow.ProcessServices[_pid].Count > 0)
                    {
                        _serviceProps = new ServiceProperties(
                           Program.HackerWindow.ProcessServices.ContainsKey(_pid) ?
                           Program.HackerWindow.ProcessServices[_pid].ToArray() :
                           new string[0]);
                        _serviceProps.Dock = DockStyle.Fill;
                        _serviceProps.PID = _pid;
                        tabServices.Controls.Add(_serviceProps);
                    }
                }
            }

            if (_processItem.IsDotNet)
            {
                try
                {
                    _dotNetCounters = new DotNetCounters(_pid, _processItem.Name);
                    _dotNetCounters.Dock = DockStyle.Fill;
                    tabDotNet.Controls.Add(_dotNetCounters);
                }
                catch
                { }
            }

            listEnvironment.ListViewItemSorter = new SortedListViewComparer(listEnvironment);
            listEnvironment.ContextMenu = listEnvironment.GetCopyMenu();
            ColumnSettings.LoadSettings(Settings.Instance.EnvironmentListViewColumns, listEnvironment);
        }
예제 #2
0
        private void InitializeSubControls()
        {
            var processStats = new ProcessStatistics(_pid);
            processStats.Dock = DockStyle.Fill;
            tabStatistics.Controls.Add(processStats);
            _processStats = processStats;

            if (_pid <= 0)
                _processStats.ClearStatistics();

            try
            {
                _tokenProps = new TokenProperties(new ProcessHandle(_pid, Program.MinProcessQueryRights));
                _tokenProps.Dock = DockStyle.Fill;
                tabToken.Controls.Add(_tokenProps);
            }
            catch
            { }

            try
            {
                using (var phandle = new ProcessHandle(_pid, Program.MinProcessQueryRights))
                {
                    var jhandle = phandle.GetJobObject(JobObjectAccess.Query);

                    if (jhandle != null)
                    {
                        using (jhandle)
                        {
                            _jobProps = new JobProperties(jhandle);
                            _jobProps.Dock = DockStyle.Fill;
                            tabJob.Controls.Add(_jobProps);
                        }
                    }
                }
            }
            catch
            { }

            if (Program.HackerWindow != null)
            {
                if (Program.HackerWindow.ProcessServices.ContainsKey(_pid))
                {
                    if (Program.HackerWindow.ProcessServices[_pid].Count > 0)
                    {
                        _serviceProps = new ServiceProperties(
                           Program.HackerWindow.ProcessServices.ContainsKey(_pid) ?
                           Program.HackerWindow.ProcessServices[_pid].ToArray() :
                           new string[0]);
                        _serviceProps.Dock = DockStyle.Fill;
                        _serviceProps.PID = _pid;
                        tabServices.Controls.Add(_serviceProps);
                    }
                }
            }

            listEnvironment.ListViewItemSorter = new SortedListViewComparer(listEnvironment);
            listEnvironment.SetDoubleBuffered(true);
            listEnvironment.SetTheme("explorer");
            listEnvironment.ContextMenu = listEnvironment.GetCopyMenu();
            ColumnSettings.LoadSettings(Properties.Settings.Default.EnvironmentListViewColumns, listEnvironment);
        }