GetMessage() private method

private GetMessage ( MSG &msg, IntPtr windowHandle, int messageFilterMin, int messageFilterMax ) : INT
msg MSG
windowHandle IntPtr
messageFilterMin int
messageFilterMax int
return INT
Ejemplo n.º 1
0
        void ProcessEvents()
        {
            Native = ConstructMessageWindow();
            CreateDrivers();

            // Subclass the window to retrieve the events we are interested in.
            OldWndProc = Functions.SetWindowLong(Parent.Handle, WndProc);
            Debug.Print("Input window attached to {0}", Parent);

            InputReady.Set();

            MSG msg = new MSG();

            while (Native.Exists)
            {
                int ret = Functions.GetMessage(ref msg, Parent.Handle, 0, 0);
                if (ret == -1)
                {
                    throw new PlatformException(String.Format(
                                                    "An error happened while processing the message queue. Windows error: {0}",
                                                    Marshal.GetLastWin32Error()));
                }

                Functions.TranslateMessage(ref msg);
                Functions.DispatchMessage(ref msg);
            }
        }
Ejemplo n.º 2
0
 public void ProcessEvents()
 {
     while (!this.IsIdle)
     {
         this.ret = Functions.GetMessage(ref this.msg, this.window.WindowHandle, 0, 0);
         if (this.ret == -1)
         {
             throw new PlatformException(string.Format("An error happened while processing the message queue. Windows error: {0}", (object)Marshal.GetLastWin32Error()));
         }
         Functions.TranslateMessage(ref this.msg);
         Functions.DispatchMessage(ref this.msg);
     }
 }
Ejemplo n.º 3
0
        private void ProcessEvents()
        {
            this.Native = this.ConstructMessageWindow();
            this.CreateDrivers();
            this.OldWndProc = Functions.SetWindowLong(this.Parent.WindowHandle, this.WndProc);
            this.InputReady.Set();
            MSG msg = new MSG();

            while (this.Native.Exists)
            {
                if (Functions.GetMessage(ref msg, this.Parent.WindowHandle, 0, 0) == -1)
                {
                    throw new PlatformException(string.Format("An error happened while processing the message queue. Windows error: {0}", (object)Marshal.GetLastWin32Error()));
                }
                Functions.TranslateMessage(ref msg);
                Functions.DispatchMessage(ref msg);
            }
        }