I'm trying to write a windows library that needs to respond to specific window messages (more specifically WM_COMMAND). I would like to not do it inside the window procedure, since that will be written by the user of the library and it would be nice to not have to force them to do something in there.
The problem is that WM_COMMANDs bypass the message queue and are sent directly to the window proc, so I can't, say, examine the queue with GetQueueStatus and filter out the messages I don't care about.
I found that windows offers the SetWindowsHookExA function, but that only works if called from a separate dll, and since mine is a std-like library, that's not going to work.
Does anybody have any idea how to do what I'm trying to do, possibily without making things cumbersome from the user side of the code? Is that even possible?