We saw some time ago that
function returns a magic cookie if it needs to thunk the message.
understands this magic cookie and calls the original window procedure
after converting the message to the appropriate character set.
But what if you want to get the actual window procedure and not a thunk?
(For example, because you're writing some debugging or diagnostic code,
and you want to log the actual window procedure address.)
The system returns a thunk if you call
but the window procedure expects Unicode messages,
or if you call
but the window procedure expects ANSI messages.
So you can avoid the character set thunk by checking
the character set of the top-level window procedure
If it reports that the top-level window procedure is Unicode,
Unrelated bonus chatter: This blog has been running for 15 years now. Sorry I didn't celebrate with some super-fascinating topic.