I have a modeless popup dialog in my app. I want to make it topmost only within the app it belongs to, not always topmost on the desktop.
I have tried to set the first parameter to wndTopMost, but this way the dialog will remain on top on the desktop, which is very bad user experience.
I have also tried wndNoTopMost with SWP_NOZORDER parameter, but this only put the dialog in front when its displayed. If I move another dialog/window to the dialog location, the dialog will be buried under the new dialog/window.
I am currently using the SetWindowPos in the OnInitDialog();
SetWindowPos(&wndNoTopMost
, myRect.left
, myRect.top
, myRect.Width()
, myRect.Height()
, SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOZORDER
);