请问一个关于鼠标指针的问题!

请问如何设置鼠标的光标用于全局?
离开本对话框也不变,类似于SPY++那样的!
[56 byte] By [sock5-|一生何求|] at [2008-2-16]
# 1
在 LButtonDown 中先执行
SetCapture();
再设置 鼠标光标

别忘了在 LButtonUp中
ReleaseCapture();
# 2
还是不行呀,这个光标无法移出对话框呀!移出后就变成系统默认的了

我是这么设置的
BOOL CClientUpdate3Dlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class

if(pMsg->message==WM_KEYDOWN)
if(pMsg->wParam==VK_F12)
{
MessageBox("F12");

//::SetCursor(AfxGetApp()->LoadCursor(IDC_CURSOR1));
SetCapture();
SetCursor(AfxGetApp()->LoadCursor(IDC_CURSOR1));

}

return CDialog::PreTranslateMessage(pMsg);
}
sock5-|一生何求| at 2007-10-24 > top of Msdn China Tech,VC/MFC,基础类...
# 3
就你上面的代码看, 你的想法就是错的

SPY++的十字光标, 也只限于一直按住鼠标左键再可以(就像我上面的代码一样), 松开就不行了

只要你的鼠标离开你的窗体, 鼠标光标就不属于你管了,虽然用 SetCapture可以强制将鼠标消
息发送到你的窗体, 但也只能在 LButtonDown中设置才可以(也就是鼠标按键必须一直按着), 具体原因我也不知道

请看 MSDN
The cursor is a shared resource. A window should set the cursor shape only when the cursor is in its client area or when the window is capturing mouse input. In systems without a mouse, the window should restore the previous cursor before the cursor leaves the client area or before it relinquishes control to another window

光标是一个共享资源, 窗体只能在鼠标处于窗体的客户区时, 才可以设置它, 只要鼠标离开窗体的客户区, WINDOW将恢复以前的光标
# 4
同意,安装楼上第一次的办法就可以做到了。
zihan-子寒 at 2007-10-24 > top of Msdn China Tech,VC/MFC,基础类...
# 5
在WM_LBUTTONDOWN中
获取wm_mousemove消息,设置光标
flyelf-空谷清音 at 2007-10-24 > top of Msdn China Tech,VC/MFC,基础类...