tags:

views:

46

answers:

1

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 do 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

A: 

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.

VitalyVal
Thanks but I figured what i was doing wrong. I used the classname static during creation. I had to register my own class. Thanks Anyways
dev ray