Window messages are not always identical for unicode/non-unicode builds. So a window procedure handles one or the other. For example, there are A/W versions for DispatchMessage.
Subclassing using SetWindowLong (32-bit) /SetWindowLongPtr (64-bit) needs to address these differences. I think this is made clear by the discussion here - What are these strange values returned from GWLP_WNDPROC?