private void CustomizeMenu(bool updateMenuChecked) { // Reset current system menu SystemMenu.ResetSystemMenu(this); // Add custom menuitems to system menu systemMenu = SystemMenu.FromForm(this); //systemMenu.AppendSeparator(); if (updateMenuChecked) { systemMenu.InsertMenu(0, ItemFlags.mfChecked, UpdateCheckMenuId, "Automatic Update Check Enabled"); timerUpdateCheck.Enabled = true; } else { systemMenu.InsertMenu(0, ItemFlags.mfUnchecked, UpdateCheckMenuId, "Automatic Update Check Enabled"); } RegistryKey rk = Registry.CurrentUser.CreateSubKey(@"Software\SystemRestoreExplorer"); if (rk != null) { rk.SetValue("AutomaticUpdateCheckEnabled", updateCheckEnabled, RegistryValueKind.DWord); } systemMenu.InsertMenu(0, AboutMenuId, "About"); systemMenu.InsertSeparator(2); }
private void CustomizeMenu(bool updateMenuChecked) { // Reset current system menu SystemMenu.ResetSystemMenu(this); // Add custom menuitems to system menu systemMenu = SystemMenu.FromForm(this); //systemMenu.AppendSeparator(); if (updateMenuChecked) { systemMenu.InsertMenu(0, ItemFlags.mfChecked, UpdateCheckMenuId, "Automatic Update Check Enabled"); timerUpdateCheck.Enabled = true; } else { systemMenu.InsertMenu(0, ItemFlags.mfUnchecked, UpdateCheckMenuId, "Automatic Update Check Enabled"); } RegistryKey rk = Registry.CurrentUser.CreateSubKey(@"Software\SystemRestoreExplorer"); if (rk != null) { rk.SetValue("AutomaticUpdateCheckEnabled", updateCheckEnabled, RegistryValueKind.DWord); } systemMenu.InsertMenu(0, AboutMenuId, "About"); systemMenu.InsertSeparator(2); }