get visible mouse cursor height
hey does anybody know how to get the visible part (not the transparent background) of the current used mouse cursor? i know they are all 32x32 and im trying to make my own ToolTip control and place it exactly under the visible mouse cursor..
im using MFC in Visual C++ 6.0
thanks
edit:
this is what i currently have:
Code:
void CTESTDlg::OnButton()
{
int i;
int j;
int height;
CDC dc;
CString txt;
BITMAP bitmap;
GetIconInfo((HICON)GetCursor(), &m_ii);
GetObject(m_ii.hbmColor, sizeof(BITMAP), &bitmap);
dc.CreateCompatibleDC(GetDC());
dc.SelectObject(m_ii.hbmColor);
height = 0;
for(i = bitmap.bmWidth - 1; i >= 0; i--)
{
for(j = bitmap.bmHeight - 1; j >= 0; j--)
{
if(dc.GetPixel(i, j) != RGB(0, 0, 0))
{
if(height < j)
{
height = j;
}
break;
}
}
}
dc.DeleteDC();
txt.Format("%d", height);
MessageBox("height: " + txt);
}
m_ii is a ICONINFO
what i get on the MessageBox is right until i set the cursor as "Use Default" in Control Panel - Mouse - Pointers (Windows XP)..
it gets invalid (a weird large number) bitmap.bmWidth and bitmap.bmHeight and i also tried painting the cursor and it will just paint a black square when i do that.. other than that it works and paints the cursor too with a black background
also i hope im not mistaking that i think the black color is the transparent color for all mouse cursors right?
thanks