|
-
March 17th, 2004, 03:31 PM
#1
making a custom cursor in an MDI app
Hi guys,
Okay, i have another question. in my MDI app i would like to have a custom cursor when the mouse is over a view window.
I have made the appropriate .cur file with the cursor's bitmap,
and have an IDC_CURSOR1.
I was hoping to tell Windows to switch cursors when it received
the ON_WM_SETCURSOR() message.
i tried first putting this in the view object, then in the child frame object.
both times, it gave me this kind of error:
ChildFrm.cpp(18) : error C2440: 'static_cast' : cannot convert from 'bool (__thiscall CChildFrame::* )(CWnd *,UINT,UINT)' to 'BOOL (__thiscall CWnd::* )(CWnd *,UINT,UINT)'
and pointed to ON_WM_SETCURSOR(). It seems that ON_WM_SETCURSOR should be in a CWnd object. But isn't CChildFrame derived from CWnd?
how can i use ON_WM_SETCURSOR() in my app? where should i catch this message so that i can switch to my custom cursor?
i am trying to follow the example of Prosise's MFC book p. 140:
Code:
ON_WM_SETCURSOR()
.
.
.
BOOL CMainWindow::OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) {
if (nHitTest == HTCLIENT) {
::SetCursor(my_cursor);
return TRUE;
}
return CFrameWnd::OnSetCursor(pWnd, nHitTest, message);
}
thanx!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|