public static WindowsMessage GetMessage(IntPtr window, uint filterMin, uint filterMax) { MSG nativeMessage; WindowsMessage.GetMessage(out nativeMessage, window, filterMin, filterMax); return(new WindowsMessage(nativeMessage)); }
public void Run() { try { lock (this.SyncRoot) { this.VerifyNotRunning(); this.Thread = Thread.CurrentThread; this.ThreadId = WindowsMessage.GetCurrentThreadId(); this.Queue = new Hashtable(); this.LastInvokeHandle = 0; this.ShutdownMode = WindowsMessageLoopShutdownMode.None; } while (true) { WindowsMessage message = WindowsMessage.GetMessage(); message = message.Translate(); message.Dispatch(); //TODO: Events etc. //TODO: Observe shutdown mode } } finally { lock (this.SyncRoot) { this.Queue?.Clear(); this.Thread = null; this.ThreadId = 0; this.Queue = null; this.LastInvokeHandle = 0; } } }
public static WindowsMessage GetMessage(IntPtr window) { return(WindowsMessage.GetMessage(window, 0, 0)); }
public static WindowsMessage GetMessage() { return(WindowsMessage.GetMessage(IntPtr.Zero)); }