public static WindowsMessage?PeekMessage(bool remove, bool noYield, IntPtr window, uint filterMin,
                                                 uint filterMax)
        {
            uint flags = (remove ? WindowsMessage.PM_REMOVE : WindowsMessage.PM_NOREMOVE) &
                         (noYield ? WindowsMessage.PM_NOYIELD : 0);

            MSG nativeMessage;

            if (!WindowsMessage.PeekMessage(out nativeMessage, window, filterMin, filterMax, flags))
            {
                return(null);
            }

            return(new WindowsMessage(nativeMessage));
        }
 public static WindowsMessage?PeekMessage(bool remove, bool noYield, IntPtr window)
 {
     return(WindowsMessage.PeekMessage(remove, noYield, window, 0, 0));
 }
 public static WindowsMessage?PeekMessage(bool remove, bool noYield)
 {
     return(WindowsMessage.PeekMessage(remove, noYield, IntPtr.Zero));
 }