I'm trying to include into my Dialog Window Procedure, that when the msg WM_CTLCOLORSTATIC is received that I get the ID of the Control that is sending the message.
case WM_CTLCOLORSTATIC:
UINT ID = GetWindowLong((HWND)lParam, GWL_ID);
Problem is... when I try to type-cast the lParam of WM_CTLCOLORSTATIC it returns the value 65535, which can't be correct; I don't even have a resource item with the maximum UINT ID 65535.
Can you give me any insight into why this is happening?
Your question is not very clear, but I guess that you got an ID of 65535, which is -1, which is pretty standard for a static control ID.
If you want to be able to differentiate your static controls, give them different IDs.
If you don't care of the color for other Static Control, just use: