如何在 C++ 应用程序中设置 "Select Precision" 光标?

How do I set the "Select Precision" cursor in a C++ application?

我需要以某种方式将光标设置为 C++ 应用程序的 "Select Precision" 指针(水平和垂直交叉点)。

有谁知道如何使用 WinApi 协议将其集成?

初始化代码中的某处:

HCURSOR precision_cursor = LoadCursor( NULL, IDC_CROSS );

和window程序:

LRESULT CALLBACK YourWindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
    switch ( msg )
    {
    case WM_SETCURSOR:
        // If you omit test below, you will change cursor also for scrollbars, frames, etc.
        if ( LOWORD( lparam ) == HTCLIENT )
        {
            SetCursor( precision_cursor );
            return TRUE;
        }
        break;
    }

    // This will also handle cursor for scrollbars and frames.
    return DefWindowProc( hwnd, msg, wparam, lparam );
}