private void get_window_handle()
        {
            if (mouse_hook != null)
            {
                mouse_hook.ClearHook();
            }
            Cursor = Cursors.Default;

            IntPtr handle = WindowFromPoint(MousePosition);
            uint   process_id;

            GetWindowThreadProcessId(handle, out process_id);
            string process_name = System.Diagnostics.Process.GetProcessById((int)process_id).ProcessName;

            if (process_name == System.Diagnostics.Process.GetCurrentProcess().ProcessName)
            {
                return;
            }

            if (process_already_in_table(process_name))
            {
                return;
            }

            dataGridView1.Rows.Add(process_name);
            Saver.save_add_process(current_preset.name, process_name.ToString());
            current_preset.processes.Add(process_name.ToString());
        }
        private void DataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            object name = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;

            if (name == null)
            {
                return;
            }
            if (old_process_name == "")
            {
                if (process_already_in_table(name.ToString(), e.RowIndex))
                {
                    dataGridView1.Rows.RemoveAt(e.RowIndex);
                    return;
                }

                Saver.save_add_process(current_preset.name, name.ToString());
                current_preset.processes.Add(name.ToString());
            }
            else if (old_process_name != name.ToString())
            {
                if (process_already_in_table(name.ToString(), e.RowIndex))
                {
                    dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = old_process_name;
                    return;
                }
                Saver.update_process_name(current_preset.name, old_process_name, name.ToString());
                int i = current_preset.processes.IndexOf(old_process_name);
                current_preset.processes.Insert(i, name.ToString());
                current_preset.processes.Remove(old_process_name);
            }
        }