X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3399e6cbed96155cdb58d11e4d44b5590504121..e8508ea8a890c90e6e72b2579780ca2ccbf40270:/src/msw/tbarmsw.cpp diff --git a/src/msw/tbarmsw.cpp b/src/msw/tbarmsw.cpp index 92b60a0fa1..2db4053acf 100644 --- a/src/msw/tbarmsw.cpp +++ b/src/msw/tbarmsw.cpp @@ -5,8 +5,8 @@ // Modified by: 13.12.99 by VZ during toolbar classes reorganization // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Copyright: (c) Julian Smart +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -34,10 +34,6 @@ #if wxUSE_TOOLBAR && defined(__WIN16__) -#if !defined(__WIN32__) && !wxUSE_IMAGE_LOADING_IN_MSW - #error wxToolBar needs wxUSE_IMAGE_LOADING_IN_MSW under Win16 -#endif - #if !defined(__GNUWIN32__) && !defined(__SALFORDC__) #include "malloc.h" #endif @@ -1103,20 +1099,16 @@ WXHBITMAP wxToolBar::CreateMappedBitmap(WXHINSTANCE WXUNUSED(hInstance), void *i WXHBITMAP wxToolBar::CreateMappedBitmap(WXHINSTANCE hInstance, WXHBITMAP hBitmap) { - HANDLE hDIB = wxBitmapToDIB((HBITMAP) hBitmap, 0); - if (hDIB) - { -#ifdef __WINDOWS_386__ - LPBITMAPINFOHEADER lpbmInfoHdr = (LPBITMAPINFOHEADER)MK_FP32(GlobalLock(hDIB)); -#else - LPBITMAPINFOHEADER lpbmInfoHdr = (LPBITMAPINFOHEADER)GlobalLock(hDIB); -#endif - HBITMAP newBitmap = (HBITMAP) CreateMappedBitmap((WXHINSTANCE) wxGetInstance(), lpbmInfoHdr); - GlobalUnlock(hDIB); + HANDLE hDIB = wxDIB::ConvertFromBitmap((HBITMAP) hBitmap); + if ( !hDIB ) + return 0; + + WXHBITMAP newBitmap = CreateMappedBitmap(hInstance, GlobalHandle(hDIB)); + GlobalFree(hDIB); - return (WXHBITMAP) newBitmap; - } - return 0; + + return newBitmap; } -#endif +#endif // wxUSE_TOOLBAR +