in Win32 API, when my WndProc receives the BN_CLICKED command, i dont know how to tell different buttons apart. i tried doing a switch case with the HWNDs, like this:
but the program wont compile. it gives me three errors.Code:case BN_CLICKED: switch ( (HWND)lParam) { // <--- error 1 case hwndButton1: case hwndButton2: }
the first says "switch expression not integral", pointing to the opening brace.
the second and third errors are the same, "case expression not constant", and point to each of the case expressions.
is this the right way to go about identifying controls, or is there a better way?