Is there a way to process code while a window's being dragged without stopping the user's drag movement?

I need to keep a foreign window (App B) in the same position relative to my window (App A). So when I move App A, App B needs to move at the same time. I'm subclassing my app and using SetWindowPos to move App B. This works, but this processing within App A kills the drag movement, so I have to click App A and start dragging again, which isn't user-friendly.

Thanks for any help.