From 0e290b6372d2fd4a56337da5b6b8801ec78bfe29 Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Thu, 29 Oct 2020 20:11:43 +0100 Subject: [PATCH] [Windows] Fix Window create function on x64. This issue affects only Windows 8.1/10 x64 built with VS2013 and VS2019. The reason is a different memory addressing on these OSs in pure 64-bit mode. This fixes #4072. Signed-off-by: Vitalii Koshura --- clientgui/msw/taskbarex.cpp | 21 ++++++++++----------- clientgui/msw/taskbarex.h | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/clientgui/msw/taskbarex.cpp b/clientgui/msw/taskbarex.cpp index fe621b17ac..ca1e1e1680 100644 --- a/clientgui/msw/taskbarex.cpp +++ b/clientgui/msw/taskbarex.cpp @@ -39,7 +39,7 @@ #endif -LRESULT APIENTRY wxTaskBarIconExWindowProc( HWND hWnd, unsigned msg, UINT wParam, LONG lParam ); +LRESULT APIENTRY wxTaskBarIconExWindowProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); wxChar* wxTaskBarExWindowClass = (wxChar*) wxT("wxTaskBarExWindowClass"); wxChar* wxTaskBarExWindow = (wxChar*) wxT("wxTaskBarExWindow"); @@ -307,10 +307,9 @@ bool wxTaskBarIconEx::IsBalloonsSupported() return true; } -long wxTaskBarIconEx::WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wParam, long lParam ) +LRESULT wxTaskBarIconEx::WindowProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { wxEventType eventType = 0; - long lReturnValue = 0; if ( WM_CLOSE == msg ) { @@ -318,10 +317,10 @@ long wxTaskBarIconEx::WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wP ProcessEvent(eventClose); if ( !eventClose.GetSkipped() ) { - lReturnValue = DefWindowProc((HWND) hWnd, msg, wParam, lParam); - } else { - lReturnValue = 0; + return DefWindowProc(hWnd, msg, wParam, lParam); } + + return 0; } else if ( WM_TASKBARCREATED == msg ) { @@ -398,20 +397,20 @@ long wxTaskBarIconEx::WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wP } else { - lReturnValue = DefWindowProc((HWND) hWnd, msg, wParam, lParam); + return DefWindowProc(hWnd, msg, wParam, lParam); } if (eventType) { wxTaskBarIconExEvent event(eventType, this); - lReturnValue = ProcessEvent(event); + return ProcessEvent(event); } - return lReturnValue; + return 0; } -LRESULT APIENTRY wxTaskBarIconExWindowProc( HWND hWnd, unsigned msg, UINT wParam, LONG lParam ) +LRESULT APIENTRY wxTaskBarIconExWindowProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { - return wxGetApp().GetTaskBarIcon()->WindowProc((WXHWND) hWnd, msg, wParam, lParam); + return wxGetApp().GetTaskBarIcon()->WindowProc(hWnd, msg, wParam, lParam); } diff --git a/clientgui/msw/taskbarex.h b/clientgui/msw/taskbarex.h index b382209980..f8b127f03c 100644 --- a/clientgui/msw/taskbarex.h +++ b/clientgui/msw/taskbarex.h @@ -81,7 +81,7 @@ public: // Implementation WXHWND CreateTaskBarWindow( wxChar* szWindowTitle ); bool IsBalloonsSupported(); - long WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wParam, long lParam ); + LRESULT WindowProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); // Data members protected: