+ POINTERINFO vIconInfo;
+
+ memset(&vIconInfo, '\0', sizeof(POINTERINFO));
+ vIconInfo.fPointer = FALSE; // we want an icon, not a pointer
+
+ memset(&vHeader, '\0', 16);
+ vHeader.cbFix = 16;
+ vHeader.cx = (ULONG)rBmp.GetWidth();
+ vHeader.cy = (ULONG)rBmp.GetHeight();
+ vHeader.cPlanes = 1L;
+ vHeader.cBitCount = 24;
+
+ hBmp = ::GpiCreateBitmap( hPSDst
+ ,&vHeader
+ ,0L
+ ,NULL
+ ,NULL
+ );
+
+ if ((hOldBitmap = ::GpiSetBitmap(hPSDst, hBmp)) == HBM_ERROR)
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+ if ((hOldBitmap = ::GpiSetBitmap(hPSSrc, (HBITMAP)rBmp.GetHBITMAP())) == HBM_ERROR)
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+ if ((lHits = ::GpiBitBlt( hPSDst
+ ,hPSSrc
+ ,4L
+ ,vPoint
+ ,ROP_SRCCOPY
+ ,BBO_IGNORE
+ )) == GPI_ERROR)
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+ if ((hOldBitmap = ::GpiSetBitmap(hPSDst, NULLHANDLE)) == HBM_ERROR)
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+ if ((hOldBitmap = ::GpiSetBitmap(hPSSrc, NULLHANDLE)) == HBM_ERROR)
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+ vIconInfo.hbmColor = hBmp;
+
+ vHeader.cy = (ULONG)rBmp.GetHeight() * 2;
+ hBmpMask = ::GpiCreateBitmap( hPSDst
+ ,&vHeader
+ ,0L
+ ,NULL
+ ,NULL
+ );
+
+ if ((hOldBitmap = ::GpiSetBitmap(hPSDst, hBmpMask)) == HBM_ERROR)
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+ if ((hOldBitmap = ::GpiSetBitmap(hPSSrc, (HBITMAP)pMask->GetMaskBitmap())) == HBM_ERROR)
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+ if ((lHits = ::GpiBitBlt( hPSDst
+ ,hPSSrc
+ ,4L
+ ,vPointMask
+ ,ROP_SRCCOPY
+ ,BBO_IGNORE
+ )) == GPI_ERROR)
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+ if ((hOldBitmap = ::GpiSetBitmap(hPSSrc, NULLHANDLE)) == HBM_ERROR)
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+ if ((hOldBitmap = ::GpiSetBitmap(hPSDst, NULLHANDLE)) == HBM_ERROR)
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ }
+
+ vIconInfo.hbmPointer = hBmpMask;