/// <summary> /// Initialises the form. /// </summary> private void MainForm_Load(object sender, EventArgs e) { // Load user settings before anything. LoadSettings(); // Default colors, taken from the Firmware Table. Used on CM Mizar too. this.colorGrid1.Colors = new ColorCollection(new Color[] { //Color.FromArgb(0, 0, 0), Color.FromArgb(0xFF, 0, 0), Color.FromArgb(0, 0xFF, 0), Color.FromArgb(0, 0, 0xFF), Color.FromArgb(0x9E, 0xA0, 0), //Color.FromArgb(0xA0, 0, 0x4E), Color.FromArgb(0, 0x4E, 0xA0), Color.FromArgb(0xFF, 0x40, 0), Color.FromArgb(0x52, 0, 0xA0), Color.FromArgb(0xFF, 0xDA, 0xAA), }); if (Firmware.IsLibraryForMizar()) { this.startupHandlerBtn.Enabled = false; this.startupHandlerBtn.Visible = false; } else { this.startupHandlerBtn.Enabled = !HasStartupHandlerInstalled(); } UpdateUIFromMouseMemory(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (Firmware.IsMousePresent()) { Application.Run(new MainForm()); } else { string message = String.Format("The CM Storm {0} mouse is not connected or couldn't be found.", Firmware.IsLibraryForMizar()? "Mizar" : "Alcor"); MessageBox.Show(message, "CmAlcorGUI", MessageBoxButtons.OK, MessageBoxIcon.Error); } }