public bool Start() { if (I60X0.SCA_GetPowerStatus() == 0) { I60X0.SCA_EnableModule(); needClose = true; } Win32.MSGQUEUEOPTIONS options = new Win32.MSGQUEUEOPTIONS(); options.dwSize = 20; options.dwFlags = 2; options.dwMaxMessages = 64; options.cbMaxMessage = 32; options.bReadAccess = true; IntPtr hMsgQ = Win32.CreateMsgQueue(null, options); if (hMsgQ == IntPtr.Zero) { return false; } hNotify = I60X0.SCA_RegisterNotification(hMsgQ); if (hNotify == IntPtr.Zero) { return false; } hEvent[0] = Win32.CreateEvent(IntPtr.Zero, false, false, null); hEvent[1] = hMsgQ; scanThread = new Thread(new ThreadStart(this.ScanThreadPorc)); scanThread.Start(); return true; }
public bool Start() { if (I60X0.SCA_GetPowerStatus() == 0) { I60X0.SCA_EnableModule(); needClose = true; } Win32.MSGQUEUEOPTIONS options = new Win32.MSGQUEUEOPTIONS(); options.dwSize = 20; options.dwFlags = 2; options.dwMaxMessages = 64; options.cbMaxMessage = 32; options.bReadAccess = true; IntPtr hMsgQ = Win32.CreateMsgQueue(null, options); if (hMsgQ == IntPtr.Zero) { return(false); } hNotify = I60X0.SCA_RegisterNotification(hMsgQ); if (hNotify == IntPtr.Zero) { return(false); } hEvent[0] = Win32.CreateEvent(IntPtr.Zero, false, false, null); hEvent[1] = hMsgQ; scanThread = new Thread(new ThreadStart(this.ScanThreadPorc)); scanThread.Start(); return(true); }