BCGSuite for MFC
void CBCGPPopupWindow::SetCloseOnOwnerChange ( BOOL  bSet = TRUE)

Specify whether the popup window is closed when the owner window is changed (e.g., moved or resized).

Parameters
bSetIf this parameter is TRUE, the window will be closed when owner is changed.