minnirok
asked on
color mouse cursor
Hi,
Can someone explain how to set the mouse cursor from a color bitmap or ico file? I have the following so far:
BOOL CMyApp::OnInit()
{
m_MyCursor = LoadCursor(IDC_MY_ICON_RES _ID);
}
BOOL CMyView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
::SetCursor(theApp.m_MyCur sor);
return TRUE;
}
I'm not sure if loading from a 32x32 .ico file is appropriate. The above works with a .cur file. So how can I modify this to get some color in the cursor?
Thanks
Can someone explain how to set the mouse cursor from a color bitmap or ico file? I have the following so far:
BOOL CMyApp::OnInit()
{
m_MyCursor = LoadCursor(IDC_MY_ICON_RES
}
BOOL CMyView::OnSetCursor(CWnd*
{
::SetCursor(theApp.m_MyCur
return TRUE;
}
I'm not sure if loading from a 32x32 .ico file is appropriate. The above works with a .cur file. So how can I modify this to get some color in the cursor?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works perfectly, thanks.
However you need to delete the default monochrome device image like follows:
Open the cursor image, select monochrome device, click Image -> Delete Device Image.
Then you can add the WM_SETCURSOR handle, and modify the function as:
BOOL CMyView::OnSetCursor(CWnd*
{
::SetCursor(AfxGetApp()->L
return TRUE;
}
Then you can use your colored cursor
More Information Refer : Q135047 HOWTO: Use Resource Editor for 16-Color 32x32 Mouse Pointers
http://support.microsoft.com/support/kb/articles/q135/0/47.asp <==
MAHESH