From 5d377fdb38312d2c7292451def6e2ce61541b9ec Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Mon, 17 Jun 2013 20:57:27 +0200 Subject: [PATCH] Attempt to fix taskbar bugs on Windows (#328, #69) --- src/SFML/Window/Win32/WindowImplWin32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SFML/Window/Win32/WindowImplWin32.cpp b/src/SFML/Window/Win32/WindowImplWin32.cpp index 0dba13ad23..cd45915c88 100644 --- a/src/SFML/Window/Win32/WindowImplWin32.cpp +++ b/src/SFML/Window/Win32/WindowImplWin32.cpp @@ -202,7 +202,7 @@ void WindowImplWin32::processEvents() if (!m_callback) { MSG message; - while (PeekMessage(&message, m_handle, 0, 0, PM_REMOVE)) + while (PeekMessage(&message, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&message); DispatchMessage(&message); @@ -884,7 +884,7 @@ LRESULT CALLBACK WindowImplWin32::globalOnEvent(HWND handle, UINT message, WPARA } // Get the WindowImpl instance corresponding to the window handle - WindowImplWin32* window = reinterpret_cast(GetWindowLongPtr(handle, GWLP_USERDATA)); + WindowImplWin32* window = handle ? reinterpret_cast(GetWindowLongPtr(handle, GWLP_USERDATA)) : NULL; // Forward the event to the appropriate function if (window)