Jump to content
  • Advertisement
Sign in to follow this  

[win32]WM_NCHITTEST and HTCAPTION problem

This topic is 2992 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Using the WM_NCHITTEST WndProc message, I'm trying to determine if the mouse is inside the actual drawing area of the window, or on a board/caption/etc. So I use this code in my WndProc:

static LRESULT r;
r = DefWindowProc(hWnd, WM_NCHITTEST, wParam, lParam);
return r;

I set a break point on the line that sets bInsideClient to false to test this, and it works on everything except the caption. Mousing over the caption does not return a HTCAPTION result. I even tried adding code like this:


inserted into the above, but it never triggered the debugbreak.

Anyone have any idea why it's never receiving a HTCAPTION result?

Share this post

Link to post
Share on other sites
When you move the mouse in the caption of the window, it sends NC_MOUSEMOVE messages instead. You should be able to use:

if(wParam == HTCAPTION)
// Do something
return 0;

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!