Jump to content
  • Advertisement
Sign in to follow this  
Damocles

[win32]WM_NCHITTEST and HTCAPTION problem

This topic is 2906 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:


case WM_NCHITTEST:
{
static LRESULT r;
r = DefWindowProc(hWnd, WM_NCHITTEST, wParam, lParam);
if (r==HTCLIENT && r!=HTCAPTION)
{
app->mouse->bInsideClient=true;
}
else
app->mouse->bInsideClient=false;
return r;
}
break;



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:


if (r==HTCAPTION)
DebugBreak();


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
Advertisement
When you move the mouse in the caption of the window, it sends NC_MOUSEMOVE messages instead. You should be able to use:


case NCMOUSEMOVE:
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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!