Q:

Does BN_CLICKED used to detect Menu and Button click or just Button click?

Should I use BN_CLICKED to detect Menu and Button click or just Button click?
So is this sample code correct:
case WM_COMMAND:
    if (HIWORD(wParam) == BN_CLICKED) // button/menu was clicked
    {
        switch(LOWORD(wParam))
        {
        // Button
        case 1000:
            MessageBox(hWnd, "OK button was clicked", "", 0);
            break;

        // Menu
        case 1001:
            MessageBox(hWnd, "Open menu was clicked", "", 0);
            break;
        }
    }
    break;

A:

Don't check the notification code first. Figure out what sent your message first. Notification codes are not guaranteed to be unique.
The documentation for WM_COMMAND says that lParam is 0 if the message was sent by an menu or an accelerator. If so, the high word of wParam is 0 for a menu and 1 for an accelerator. Check that first.
if (lParam == 0)
    if (HIWORD(wParam) == 0)
        // menu
        switch (LOWORD(wParam)) {
        case /* id of menu option 1 */:
            /* code for menu option 1 */
            break; // or return or whatever
        case /* id of menu option 2 */:
            /* code for menu option 2 */
            break;
        ...
        }
    else
        // accelerator
        switch (LOWORD(wParam)) {
        case /* id of accelerator 1 */:
            /* code for accelerator 1 */
            break;
        case /* id of accelerator 2 */:
            /* code for accelerator 2 */
            break;
        ...
        }
else
    // control
    switch (LOWORD(wParam)) {
    case /* id of button control */:
        switch (HIWORD(wParam)) {
        case BN_CLICKED:
            // clicked action
        ...
        }
        break;
    case /* id of some other control */
        /* likewise */
        break;
    ...
    }

