public Main() { InitializeComponent(); // Initialize the config file config = new Config(this, overlay); // Overlay setup overlay.Show(); overlay.TopMost = true; overlay.Bounds = Screen.AllScreens[0].Bounds; button_colorDialog.BackColor = overlay.cursorColor; // Attempt to load the config file, if any config.LoadConfig(); // Low level mouse hook (MouseHook.cs) MouseHook.Start(); MouseHook.MouseDownHooked += new EventHandler(MouseDownHandler); MouseHook.MouseUpHooked += new EventHandler(MouseUpHandler); MouseHook.MouseMoveHooked += new EventHandler(MouseMoveHandler); // Mouse smoothing updater lineSmoothingTimer.Elapsed += new ElapsedEventHandler(LineSmoothingUpdate); lineSmoothingTimer.Interval = 5; // Line processing updater lineProcessingTimer.Elapsed += new ElapsedEventHandler(LineProcessingUpdate); lineProcessingTimer.Interval = config.smoothingStrength; // Register a raw input listener int size = Marshal.SizeOf(typeof(RawInputDevice)); RawInputDevice[] devices = new RawInputDevice[1]; devices[0].UsagePage = 1; devices[0].Usage = 2; devices[0].Flags = 0x00000100; devices[0].Target = Handle; RegisterRawInputDevices(devices, 1, size); }
private void ToolStripMenuItem_restoreDefaults_Click(object sender, EventArgs e) { config.LoadConfig(true); MessageBox.Show("Default settings restored.", "Silky Shark", MessageBoxButtons.OK, MessageBoxIcon.Information); }