private void UnexpectedModal(string name, IntPtr hWnd, Form form)
 {
     Win32.DestroyWindow(hWnd);
     unexpectedModals.Add(name);
 }
 static MouseController()
 {
     Win32.SystemParametersInfo(Win32.SPI_GETMOUSEHOVERTIME, 0, out hoverTime, 0);
     hoverTime += hoverTime / 2;
 }
 private void BeginListening()
 {
     if (!listening)
     {
         listening = true;
         // Note: the callback is saved as a member to keep the CLR from shuffling off the pointer
         // before the callback is used.
         // If we try to assign the call back "inline" we get memory violation errors.
         callback     = Callback_ModalListener;
         handleToHook = Win32.SetWindowsHookEx(HCBT_ACTIVATE, callback, IntPtr.Zero, Win32.GetCurrentThreadId());
     }
 }