From looking at the coordinates of mpWnd I assume that this is a child window. A child window, however, cannot be the owner of a popup window. See article:
Window Features[
^]
The easiest way to solve that is to find the top-level parent of mpWnd (GetTopLevelParent) and use that in CreateEx as owner.