I have a CWnd Derived object used in a dialog. I need to be able to drag it anywhere in the dialog. I have a code overriding OnNCHitTest for moving a dialog dragging it from a place other than the title bar. Is there any equivalent code to d开发者_如何学编程o the same to move this CWnd. The following code isnt working.
UINT CBaseSliderBtn::OnNcHitTest(CPoint point)
{
UINT ret=CWnd::OnNcHitTest( point );
if (ret == HTCLIENT)
return HTCAPTION;
}
If this isn't the right way, please suggest other optimum method to drag the slider.
ThanksYour example simply simulate mouse actions, as their occur with dialog title. And the dialog title allows you to drag the dialog. As for your custom window, it is probably a child window and does allow dragging using a window part. You should process mouse input to implement dragging.
精彩评论