HCURSOR m_hCursor;
//使用系统光标
IDC_ARROW Standard arrow cursor
IDC_IBEAM Standard text-insertion cursor
IDC_WAIT Hourglass cursor used when Windows performs a time-consuming task
IDC_CROSS Cross-hair cursor for selection
IDC_UPARROW Arrow that points straight up
IDC_SIZE Obsolete and unsupported; use IDC_SIZEALL
IDC_SIZEALL A four-pointed arrow. The cursor to use to resize a window.
IDC_ICON Obsolete and unsupported. Use IDC_ARROW.
IDC_SIZENWSE Two-headed arrow with ends at upper left and lower right
IDC_SIZENESW Two-headed arrow with ends at upper right and lower left
IDC_SIZEWE Horizontal two-headed arrow
IDC_SIZENS Vertical two-headed arrow
Example:
m_hCursor = AfxGetApp()->LoadStandardCursor(IDC_UPARROW);//使用自定义光标
hCursor = AfxGetApp()->LoadCursor(IDC_MYCURSOR);
//IDC_MYCURSOR在资源编辑其中添加//最后调用
::SetCursor(m_hCursor);
//使用系统光标
IDC_ARROW Standard arrow cursor
IDC_IBEAM Standard text-insertion cursor
IDC_WAIT Hourglass cursor used when Windows performs a time-consuming task
IDC_CROSS Cross-hair cursor for selection
IDC_UPARROW Arrow that points straight up
IDC_SIZE Obsolete and unsupported; use IDC_SIZEALL
IDC_SIZEALL A four-pointed arrow. The cursor to use to resize a window.
IDC_ICON Obsolete and unsupported. Use IDC_ARROW.
IDC_SIZENWSE Two-headed arrow with ends at upper left and lower right
IDC_SIZENESW Two-headed arrow with ends at upper right and lower left
IDC_SIZEWE Horizontal two-headed arrow
IDC_SIZENS Vertical two-headed arrow
Example:
m_hCursor = AfxGetApp()->LoadStandardCursor(IDC_UPARROW);//使用自定义光标
hCursor = AfxGetApp()->LoadCursor(IDC_MYCURSOR);
//IDC_MYCURSOR在资源编辑其中添加//最后调用
::SetCursor(m_hCursor);
再问一个问题
如何得到一个控件的句柄?
例如在VIEW ONDRAW时得到一个的BOTTON句柄
当然MOUSE移动时发出WM_MOUSEMOVE的消息,
xPos = LOWORD(lParam);
yPos = HIWORD(lParam);
根据前后两次的位置可以确定MOUSE的移动方向。