Fixed message filtering check.

diff --git a/windows/queue.c b/windows/queue.c
index d3f30f3..988016a 100644
--- a/windows/queue.c
+++ b/windows/queue.c
@@ -1050,7 +1050,7 @@
                 if (!first && !last)
                     break;   /* found it */
                 
-                if ((msg->message >= first) && (msg->message <= last))
+                if ((msg->message >= first) && (!last || (msg->message <= last)))
                     break;   /* found it */
             }
 	}