Win32 Window Creation - No Edge Cursors, or cursor hit along edges appears to extremely small

75 views Asked by At

Yes, this is similar to a lot of posts, but none seem to fit. I have been doing this for decades, so I think I am missing some Windows 11 thing. Or, (most likely) I have simply forgotten how to Create Windows as it is not a common thing on large projects (you do it once and forget it). I have not overriden WM_SETCURSOR.

Anyone know why we need a WS_EX_OVERLAPPEDWINDOW and a WS_OVERLAPPEDWINDOW? Other than CreateWindow is obsolete and CreateWindowEx is recommended?

Relevant code...

ATOM RegisterWndClassPrimary(HINSTANCE hInstance)
{
    WNDCLASSEX          wcex;
    wcex.cbSize         = sizeof(WNDCLASSEX);
    wcex.style          = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
    wcex.lpfnWndProc    = WndProcPrimary;
    wcex.cbClsExtra     = 0;
    wcex.cbWndExtra     = 0;
    wcex.hInstance      = hInstance;
    wcex.hIcon          = LoadIcon(NULL, MAKEINTRESOURCE(IDI_RCAMSENSOR));
    wcex.hCursor        = LoadCursor(NULL, IDC_ARROW);
    wcex.hbrBackground  = CreateSolidBrush(COLOR_GREY_WINDOW);
    wcex.lpszMenuName   = MAKEINTRESOURCE(IDC_RCAMSENSOR);
    wcex.lpszClassName  = TEXT(SZ_WND_CLASS_PRIMARY);
    wcex.hIconSm        = LoadIcon(NULL, MAKEINTRESOURCE(IDI_SMALL));
    return              RegisterClassEx(&wcex);
}

RegisterWndClassPrimary(hInstance);

hWnd = CreateWindowEx(
            WS_EX_OVERLAPPEDWINDOW,
            TEXT(SZ_WND_CLASS_PRIMARY),
            L"",
            WS_OVERLAPPEDWINDOW,
            CW_USEDEFAULT, 
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            NULL, 
            NULL,
            g_hInst, 
            NULL);
1

There are 1 answers

0
Syntactics On

Instead of nuking this, maybe someone can benefit from my misfortune...

DON'T Override WM_NCMOUSEMOVE

In all my ministrations to fix this I had tried that and left the code in (sound familiar).

All is well now.