1 2 3 4 5 6 7 8 9 10 11 12 13
|
void DrawHCURSORtoHDC(HDC hdc, HCURSOR hIcon, int PosX=0, int PosY=0)
{
BITMAP BMInf;
ICONINFO csII;
GetIconInfo(hIcon, &csII);
GetObject(csII.hbmColor, sizeof(BMInf), &BMInf);
BitmapDC MemDCExercising(BMInf.bmWidth ,BMInf.bmHeight);
DrawIcon(MemDCExercising,0,0,hIcon);
TransparentBlt(hdc, PosX, PosY, BMInf.bmWidth , BMInf.bmHeight, MemDCExercising, 0, 0,BMInf.bmWidth , BMInf.bmHeight,GetPixel(MemDCExercising,0,0) );
DestroyCursor(hIcon);
::DeleteObject(csII.hbmColor);
::DeleteObject(csII.hbmMask);
}
|