public QuickForm() { InitializeComponent(); boLoSearch = new BoLoSearch.BoLoSearch(); SetStartup(_settings.LaunchOnStartup); update = new CheckUpdate(_settings); AddTrayIcons(); mouseHook.MouseDown += new MouseEventHandler((s, e) => { AddMouseEvent("MouseDown", e.Button.ToString(), e.X, e.Y, ""); }); mouseHook.MouseUp += new MouseEventHandler((s, e) => { AddMouseEvent("MouseUp", e.Button.ToString(), e.X, e.Y, ""); }); mouseHook.MouseWheel += new MouseEventHandler((s, e) => { AddMouseEvent("MouseWheel", "", -1, -1, e.Delta.ToString()); }); mouseHook.Start(); keyboardHook.KeyDown += new KeyEventHandler((s, e) => { KeyboardEvent("KeyDown", e.KeyCode.ToString(), "", e.Shift.ToString(), e.Alt.ToString(), e.Control.ToString()); }); keyboardHook.KeyUp += new KeyEventHandler((s, e) => { KeyboardEvent("KeyUp", e.KeyCode.ToString(), "", e.Shift.ToString(), e.Alt.ToString(), e.Control.ToString()); }); keyboardHook.KeyPress += new KeyPressEventHandler((s, e) => { KeyboardEvent("KeyPress", "", e.KeyChar.ToString(), "", "", ""); }); keyboardHook.Start(); // 自定义关机和logoff的事件 Microsoft.Win32.SystemEvents.SessionEnding += SessionEndingEvent; UpTimer.Enabled = true; UpTimer.Start(); CreateFile(); _trayIcon.Icon = _settings.aiTranslate ? Resources.favicon_open : Resources.favicon_close; registerCom(true); Thread thread_update = new Thread(UpdateCheck); thread_update.IsBackground = true; thread_update.Start(); }
public SearchForm(BoLoSearch.BoLoSearch boLoSearchX) { InitializeComponent(); QuickForm.StartUpdateDB = true; boLoSearch = boLoSearchX; InputTx.TextChanged += InputTx_TextChanged; statusLabel.Text = " Ready"; QuickForm.STOPTranlate = true; }