怎麼發消息

Shaojianli 2004-04-02 01:06:41
我寫了一個浮動按鈕的程序,想使鼠標移動到Button上時改變其形狀,我在Move的消息響應函數裡面發消息給主畫面Dlg,為沈麼就是接受不到,我是這樣發的
::SendMessage(::GetParent(GetSafeHwnd()),WM_SETCURSOR,CURSOR_DRAW,0);
CURSOR_DRAW是我自己定義的.
BOOL CFuDongButDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
switch(message) {
case CURSOR_NORMAL:
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_CROSS));
break;
case CURSOR_DRAW:
SetCursor(AfxGetApp()->LoadCursor(IDC_CURSOR1));
break;
}
return TRUE;
}
但是為沈麼就是改變不了.謝謝指教!

扂迡賸珨跺腹雄偌聽腔最唗,砑妏扷梓痄雄善Button奻奀蜊曹倛袨,扂婓Move腔秏洘砒茼滲杅爵醱楷秏洘跤翋賒醱Dlg,峈朻欒憩岆諉忳祥善,扂岆涴欴楷腔
::SendMessage(::GetParent(GetSafeHwnd()),WM_SETCURSOR,CURSOR_DRAW,0);
CURSOR_DRAW岆扂赻撩隅砱腔.
BOOL CFuDongButDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
switch(message) {
case CURSOR_NORMAL:
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_CROSS));
break;
case CURSOR_DRAW:
SetCursor(AfxGetApp()->LoadCursor(IDC_CURSOR1));
break;
}
return TRUE;
}
筍岆峈朻欒憩岆蜊曹祥賸.郅郅硌諒!
...全文
5 点赞 收藏 回复
写回复
回复
切换为时间正序
请发表友善的回复…
发表回复

还没有回复,快来抢沙发~

发动态
发帖子
VC/MFC
创建于2007-09-28

1.5w+

社区成员

VC/MFC相关问题讨论
申请成为版主
社区公告
暂无公告