Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to load a cursor?

Status
Not open for further replies.

zulfi1234

Instructor
Jul 2, 2000
32
PK
I have created an icon using the bitmap editor. How I can load the icon as the cursor? I am doing the<br>&nbsp;following things in my dialog's implementation file:<br><br>&nbsp;m_Cursor=3;<br>&nbsp;hCursor = AfxGetApp()-&gt;LoadCursor(IDI_ICON3);<br>&nbsp;::SetCursor(hCursor);<br><br>&nbsp;And in my dialog's header file I have declared<br>&nbsp;HCURSOR hCursor;<br><br>&nbsp;Zulfi.
 
Dear Zulfi,<br><br>Windows sends a WM_SETCURSOR. The default MFC handler sets the cursor to the default cursor registered to the window. To set the cursor you can register it to the window, or override the MFC WM_SETCURSOR handler through the virtual function CWnd::OnSetCursor(). In your override you can call SetCursor() to display your custom cursor.<br><br>Hope this helps<br>-pete
 
I want to change the cursor when I click the radio button on my dlg. The cursor should be changed to an icon. Should I call OnSetCursor ( ) through my radio button handler??<br><br>Zulfi
 
Zulfi,<br><br>I've never done what you are describing, but I would try SendMessage(WM_SETCURSOR, 0, 0L)<br><br>-pete
 
Dear palbano,<br>Thanks for your interest. I got my problem solved.<br>Zulfi.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top