I'm using VC++ Express to create a DLL for a global hook system I'm writing. The unusual thing is that as I'm trying to catch the non-client messages I can't seem to get the to trigger properly. For example I'm trying to catch the WM_NCRBUTTONUP message anywhere on the non-client area and it doesn't trigger unless I click the tiny little border around the non-client buttons. If I click directly on the minimize button ... nothing happens except for the system menu popup, but if I click on the tiny little border around the minimize button, the callback triggers. Could anyone possibly explain this behavior to me or tell me what in the world I'm doing wrong

NC messages oddity UPDATE
Nate Smith6744
erdsah88
Narayan12345
Ok, here's a little update. Using the following callback function:
djnilm
The behavior is different when you've got the classic window appearance selected, right-clicking the minimize button does not display the window menu and you'll always get a WM_NCRBUTTONUP.
As a workaround, you could record WM_NCRBUTTONDOWN, then look for any RBUTTONUP message to know that the minimize button got right-clicked. Or just do what you want to do (an easter egg ) when you see WM_NCRBUTTONDOWN. Note however that this may well stop working when Microsoft invents a new theme. When Raymond Chang does his compability tests, he'll make sure 99.99% of the programs still work. But he'll miss this...
Jacaranda
David Hernandez Diez
I don't have anything but the express versions of VStudio so Spy++ is not available to me, however I got myself a utility that does the same thing. Interestingly enough I ended up with results like you described.
This has to be a problem with the API because I used the spy on a standard explorer window with nothing else running and if I right click the min button in the middle I get a NCRBUTTONDOWN and a RBUTTONUP. However if I click the min button over to the right near the edge I get a NCRBUTTONDOWN and NCRBUTTONUP. What this means to me is that it's not a bug in my code. So how in the heck are people writing apps that catch the right click on the min button. I know they are doing it because i have one. I just want to know the workaround. I wonder if MS is aware of this little glitch.
I asked a friend to try this on his computer and he did NOT get the same results so there must be some commonality that we have causing this issue.