private void Btn_Ok_Click(object sender, EventArgs e)
 {
     if (gameDir != "" && gameExe == "BF2.exe")
     {
         Bf2Registry.DeleteRegistry(is64Bits);
         Bf2Registry.NewGame(gameDir, gameExe, is64Bits);
         this.Close();
     }
 }
        private void Btn_Apply_Click(object sender, EventArgs e)
        {
            Btn_Apply.Enabled = false;
            bool KeyOk = false;

            TextBox[] bf2_key   = { TxtBx_Bf2key1, TxtBx_Bf2key2, TxtBx_Bf2key3, TxtBx_Bf2key4, TxtBx_Bf2key5 };
            TextBox[] bf2SF_key = { TxtBx_Bf2SFkey1, TxtBx_Bf2SFkey2, TxtBx_Bf2SFkey3, TxtBx_Bf2SFkey4, TxtBx_Bf2SFkey5 };
            foreach (TextBox txtbf2 in bf2_key)
            {
                txtbf2.ForeColor = Color.Black;
                if (txtbf2.Text.Length == 4)
                {
                    KeyOk = true;
                }
                else
                {
                    SystemSounds.Asterisk.Play();
                    txtbf2.Focus();
                    KeyOk            = false;
                    txtbf2.ForeColor = Color.Red;
                    break;
                }
            }
            if (KeyOk)
            {
                foreach (TextBox txtSF in bf2SF_key)
                {
                    txtSF.ForeColor = Color.Black;
                    if (txtSF.Text.Length == 4)
                    {
                        KeyOk = true;
                    }
                    else
                    {
                        SystemSounds.Asterisk.Play();
                        txtSF.Focus();
                        KeyOk           = false;
                        txtSF.ForeColor = Color.Red;
                        break;
                    }
                }
            }

            if (KeyOk)
            {
                const int KeyLenght = 24;
                string    BF2_key = "", BF2sf_key = "";
                foreach (TextBox txtbf2 in bf2_key)     // Bf2 key
                {
                    BF2_key += txtbf2.Text;
                    if (BF2_key.Length < KeyLenght && !CheckBx_Mode1.Checked)
                    {
                        BF2_key += "-";
                    }
                }
                foreach (TextBox txtSF in bf2SF_key)    // Bf2 Special Forces key
                {
                    BF2sf_key += txtSF.Text;
                    if (BF2sf_key.Length < KeyLenght && !CheckBx_Mode1.Checked)
                    {
                        BF2sf_key += "-";
                    }
                }
                Bf2Registry.SetKey(BF2_key, BF2sf_key, out bool Error, is64Bits);
                if (!Error)
                {
                    MessageBox.Show("Your CD-KEY has been successfully configured!", "All Done !", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                    Btn_Apply.Focus();
                }
            }
            Btn_Apply.Enabled = true;
        }