From looking at the MFC source code, I figured that they implement their own method. It seems that there is no built-in way. You'll need to get the right messages (WM_MOUSEMOVE or WM_MOVE or such) and handle them in a way to check where the window is and set it's pos to the frame of the parent window if near enough. You'll need to implement your own way to do that.