Ejemplo n.º 1
0
        private void buttonEditProtected_Click(object sender, EventArgs e)
        {
            try
            {
                using (ComboBoxPickerWindow picker = new ComboBoxPickerWindow(new[] { "Protect", "Unprotect" }))
                {
                    picker.Message = "Select an action below:";
                    picker.SelectedItem = string.Equals(this.textProtected.Text, "Protected", StringComparison.OrdinalIgnoreCase) ? "Protect" : "Unprotect";

                    if (picker.ShowDialog() == DialogResult.OK)
                    {
                        //KProcessHacker.Instance.SetProcessProtected(_pid, string.Equals(picker.SelectedItem, "Protect", StringComparison.OrdinalIgnoreCase));
                        this.UpdateProtected();
                    }
                }
            }
            catch (Exception ex)
            {
                PhUtils.ShowException("Unable to change process protection", ex);
            }
        }
Ejemplo n.º 2
0
        private void buttonEditProtected_Click(object sender, EventArgs e)
        {
            try
            {
                ComboBoxPickerWindow picker = new ComboBoxPickerWindow(new string[] { "Protect", "Unprotect" });

                picker.Message = "Select an action below:";
                picker.SelectedItem = (textProtected.Text == "Protected") ? "Protect" : "Unprotect";

                if (picker.ShowDialog() == DialogResult.OK)
                {
                    KProcessHacker.Instance.SetProcessProtected(_pid, picker.SelectedItem == "Protect");
                    this.UpdateProtected();
                }
            }
            catch (Exception ex)
            {
                PhUtils.ShowException("Unable to change process protection", ex);
            }
        }