开发者

Using OnNcHItTest for a CWnd not CDialog

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.

Thanks


Your 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜