public MainFrm() { InitializeComponent(); Directory.SetCurrentDirectory(Application.StartupPath); sqlMgr = new SQLiteMgr(Environment.CurrentDirectory, "twz", typeof(TWZDData)); strokeMgr = new StrokeMgr("", pictureBox1); watch = new Stopwatch(); rand = new Random(); winTimer = new System.Timers.Timer((double)(Variable.AlertIntervalMin * 60 * 1000)); taskTimer = new System.Timers.Timer(50.0); winTimer.Elapsed += new ElapsedEventHandler(OnAlert); taskTimer.Elapsed += new ElapsedEventHandler(DoAllTask); winTimer.Enabled = true; frmState = MainFrm.WinState.Halt; appIcon = (Environment.OSVersion.Version.Major <= 5) ? Resources.彩色 : Resources.黑白; Opacity = 0.0; notifyIcon1.Icon = appIcon; GetConfig(); CVDllImport.CVInit(); //鼠标穿透 //int WS_EX_APPWINDOW = 0x00040000; long STYLE = CVDllImport.GetWindowLong(Handle, -20); long WS_EX_TOOLWINDOW = 0x00000080; long WS_EX_TRANSPARENT = 0x00000020; CVDllImport.SetWindowLong(Handle, -20, STYLE | 0x80000 | (WS_EX_TRANSPARENT) | WS_EX_TOOLWINDOW); }
public Form1() { InitializeComponent(); CheckForIllegalCrossThreadCalls = false; _mgr = new SQLiteMgr(".", "twz", typeof(TWZDData)); }