+ }
+ else if (flags == wxBITMAP_TYPE_ICO)
+ {
+#if wxUSE_RESOURCE_LOADING_IN_MSW
+ refData->m_hCursor = (WXHCURSOR) IconToCursor(WXSTRINGCAST cursor_file, wxGetInstance(), hotSpotX, hotSpotY, &refData->m_width, &refData->m_height);
+ refData->m_destroyCursor = TRUE;
+#endif
+ }
+ else if (flags == wxBITMAP_TYPE_BMP)
+ {
+#if wxUSE_RESOURCE_LOADING_IN_MSW
+ HBITMAP hBitmap = 0;
+ HPALETTE hPalette = 0;
+ bool success = wxReadDIB(WXSTRINGCAST cursor_file, &hBitmap, &hPalette) != 0;
+ if (!success)
+ return;
+ if (hPalette)
+ DeleteObject(hPalette);
+ POINT pnt;
+ pnt.x = hotSpotX;
+ pnt.y = hotSpotY;
+ refData->m_hCursor = (WXHCURSOR) MakeCursorFromBitmap(wxGetInstance(), hBitmap, &pnt);
+ refData->m_destroyCursor = TRUE;
+ DeleteObject(hBitmap);
+#endif
+ }
+
+#if WXWIN_COMPATIBILITY_2
+ refData->SetOk();
+#endif // WXWIN_COMPATIBILITY_2