+// ----------------------------------------------------------------------------
+// helpers
+// ----------------------------------------------------------------------------
+
+static HBITMAP GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask)
+{
+ HBITMAP hbmpMask;
+ wxBitmap *bmpMask = NULL;
+
+ if ( mask.Ok() )
+ {
+ hbmpMask = GetHbitmapOf(mask);
+ }
+ else
+ {
+ wxMask *pMask = bitmap.GetMask();
+ if ( pMask )
+ {
+ hbmpMask = (HBITMAP)pMask->GetMaskBitmap();
+ }
+ else
+ {
+ // create a non transparent mask - apparently, this is needed under
+ // Win9x (it doesn't behave correctly if it's passed 0 mask)
+ bmpMask = new wxBitmap(bitmap.GetWidth(), bitmap.GetHeight(), 1);
+
+ wxMemoryDC dcMem;
+ dcMem.SelectObject(*bmpMask);
+ dcMem.Clear();
+ dcMem.SelectObject(wxNullBitmap);
+
+ hbmpMask = GetHbitmapOf(*bmpMask);
+ }
+ }
+
+ // windows mask convention is opposite to the wxWindows one
+ HBITMAP hbmpMaskInv = wxInvertMask(hbmpMask);
+ delete bmpMask;
+
+ return hbmpMaskInv;
+}
+
+#endif // Win95