]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
fixed SaveDIB() crash with BW images (patch 1045884)
[wxWidgets.git] / src / msw / window.cpp
index 88dfe6c276b9d3b6e573115e6d874c168d1a1c29..a2c31ccb8f7c00dc28d95b6f34591855e116552a 100644 (file)
@@ -5815,7 +5815,11 @@ public:
     static LRESULT CALLBACK MsgHookProc(int nCode, WPARAM wParam, LPARAM lParam)
     {
         MSG *msg = (MSG*)lParam;
-        if ( msg->message == WM_NULL )
+
+        // only process the message if it is actually going to be removed from
+        // the message queue, this prevents that the same event from being
+        // processed multiple times if now someone just called PeekMessage()
+        if ( msg->message == WM_NULL && wParam == PM_REMOVE )
         {
             wxTheApp->ProcessPendingEvents();
         }