X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2edc119be3723571a39220acf6d82ce9d7c753a1..49e399d8c0f2683a885bfec77e43cfde3b2249f4:/src/msw/icon.cpp diff --git a/src/msw/icon.cpp b/src/msw/icon.cpp index 30edc93816..a7e1fcad9d 100644 --- a/src/msw/icon.cpp +++ b/src/msw/icon.cpp @@ -126,7 +126,7 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bmp) HICON hicon = ::CreateIconIndirect(&iconInfo); if ( !hicon ) { - wxLogLastError("CreateIconIndirect"); + wxLogLastError(wxT("CreateIconIndirect")); } else { @@ -142,7 +142,16 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bmp) #else // Win16 // there are some functions in curico.cpp which probably could be used // here... - wxFAIL_MSG("not implemented"); + // This probably doesn't work. + HBITMAP hBitmap = (HBITMAP) bmp.GetHBITMAP(); + HICON hIcon = MakeIconFromBitmap((HINSTANCE) wxGetInstance(), hBitmap); + if (hIcon) + { + SetHICON((WXHICON)hIcon); + SetSize(bmp.GetWidth(), bmp.GetHeight()); + } + +// wxFAIL_MSG("Bitmap to icon conversion (including use of XPMs for icons) not implemented"); #endif // Win32/16 }