]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/icon.cpp
wxListCtrl::InsertItem() returned wrong index.
[wxWidgets.git] / src / msw / icon.cpp
index 30edc93816afacb514a48342a274cc8baf3a7b34..a7e1fcad9dc95ab7979fd27857664783b7003201 100644 (file)
@@ -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
 }