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); } }
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); } }
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); } }
public void ProcessEvents() { while (!IsIdle) { if (!Functions.PeekMessage(ref msg, window.WindowHandle, 0, 0, Functions.PeekMessageOption.PM_REMOVE)) { throw new PlatformException(String.Format( "An error happened while processing the message queue. Windows error: {0}", Marshal.GetLastWin32Error())); } //Functions.GetMessage(ref msg, window.WindowHandle, 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); } }