Manage to find the answer - you need to override the ON_WM_WINDOWPOSCHANGING message.