From e126ddc11cc1bb008abeb0d3d4dc587acd2d668a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 21 Oct 2021 16:34:52 +0100 Subject: [PATCH] Use more suitable type for MSWReplaceImageHandle() parameter It's a handle, so make it a WXHANDLE rather than WXLPARAM and avoid casting the handle when calling it (there is still a cast when calling ::SendMessage() inside this function, but this is unavoidable and this cast was already there anyhow). No real changes. --- include/wx/msw/statbmp.h | 2 +- src/msw/statbmp.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/wx/msw/statbmp.h b/include/wx/msw/statbmp.h index 39b0cbbd4b..c3a0449507 100644 --- a/include/wx/msw/statbmp.h +++ b/include/wx/msw/statbmp.h @@ -132,7 +132,7 @@ private: // Replace the image at the native control level with the given HBITMAP or // HICON (which can be 0) and destroy the previous image if necessary. - void MSWReplaceImageHandle(WXLPARAM handle); + void MSWReplaceImageHandle(WXHANDLE handle); wxDECLARE_DYNAMIC_CLASS(wxStaticBitmap); diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index 7c157ab9e7..610c513f8b 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -221,7 +221,7 @@ void wxStaticBitmap::DoPaintManually(wxPaintEvent& WXUNUSED(event)) true /* use mask */); } -void wxStaticBitmap::MSWReplaceImageHandle(WXLPARAM handle) +void wxStaticBitmap::MSWReplaceImageHandle(WXHANDLE handle) { HGDIOBJ oldHandle = (HGDIOBJ)::SendMessage(GetHwnd(), STM_SETIMAGE, m_icon.IsOk() ? IMAGE_ICON : IMAGE_BITMAP, (LPARAM)handle); @@ -271,7 +271,7 @@ void wxStaticBitmap::DoUpdateImage(const wxSize& sizeOld, bool wasIcon) .TurnOn(isIcon ? SS_ICON : SS_BITMAP); } - MSWReplaceImageHandle((WXLPARAM)handle); + MSWReplaceImageHandle(handle); m_currentHandle = (WXHANDLE)handle; m_ownsCurrentHandle = handle != handleOrig;