private void CAB42_Shown(object sender, EventArgs e) { var shellInfo = new global::C42A.Win32.ShellExtension(".c42"); if (!shellInfo.IsDefaultApplication()) { var message = "This application is not registered as the default handler for .c42 files.\r\n" + "Do you want this program to be the default handler for CAB 42 files?"; var dialogResult = MessageBox.Show( this, message, "File Extension Association", MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button2); if (dialogResult == System.Windows.Forms.DialogResult.Yes) { shellInfo.Save(); } } }