怎麼發消息
我寫了一個浮動按鈕的程序,想使鼠標移動到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;
}
筍岆峈朻欒憩岆蜊曹祥賸.郅郅硌諒!