更改win32标签上的光标

时间:2014-07-22 00:51:12

标签: winapi visual-c++

我想只为一个标签更改鼠标光标。如果我使用SetClassLong更改所有标签的光标,我被告知我应该使用SetWindowLong,因为它在[here] [1]中说明但是由于某种原因鼠标光标没有改变。

我使用的是一个简单的DialogBox。

修改

抱歉,如果我没有包含我的代码。已经很晚了,我累了。 根据建议,我将在下面发布答案。

1 个答案:

答案 0 :(得分:0)

感谢@Potter。我有点找到answer for changing the cursor for a win32 label control

  1. 按照answer to this question的说法,你会有这样的事情。

    case WM_SETCURSOR:
        if((HWND)wParam == GetDlgItem( hWnd, 1014)) {
            SetCursor(LoadCursor(NULL, IDC_HAND)); 
            SetWindowLongPtr(hWnd, DWLP_MSGRESULT, TRUE);
            return TRUE;
        }
    
  2. 在控件的属性中,请务必将Notify设置为True。

  3. static text label properties win32 notify property

相关问题