+// ----------------------------------------------------------------------------
+// helpers
+// ----------------------------------------------------------------------------
+
+static HBITMAP GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask)
+{
+ HBITMAP hbmpMask;
+ wxMask *pMask;
+ bool deleteMask = false;
+
+ if ( mask.Ok() )
+ {
+ hbmpMask = GetHbitmapOf(mask);
+ pMask = NULL;
+ }
+ else
+ {
+ pMask = bitmap.GetMask();
+ if ( !pMask )
+ {
+ // use the light grey count as transparent: the trouble here is
+ // that the light grey might have been changed by Windows behind
+ // our back, so use the standard colour map to get its real value
+ wxCOLORMAP *cmap = wxGetStdColourMap();
+ wxColour col;
+ wxRGBToColour(col, cmap[wxSTD_COL_BTNFACE].from);
+
+ pMask = new wxMask(bitmap, col);
+
+ deleteMask = true;
+ }
+
+ hbmpMask = (HBITMAP)pMask->GetMaskBitmap();
+ }
+
+ // windows mask convention is opposite to the wxWidgets one
+ HBITMAP hbmpMaskInv = wxInvertMask(hbmpMask);
+
+ if ( deleteMask )
+ {
+ delete pMask;
+ }
+
+ return hbmpMaskInv;
+}
+
+#endif // Win95