Try passing the thirdpty window HWND as the owner of your popup window when you create it.
Read the section about owned windows here for reference: https://learn.microsoft.com/en-us/windows/win32/winmsg/window-features
-SM
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a handle
to third party window (not created by me, retrieved using the FindWindow
function). Now I'd like to create a small popup style window that will ALWAYS be laid down ovev/on top of that third party window. The case is I don't wanna the popup to be always above all the system windows, but ONLY above the window that I've described so I don't wanna use the HWND_TOPMOST
option in the SetWindowPos
function.
How can i achieve it without using the HWND_TOPMOST
flag?
Try passing the thirdpty window HWND as the owner of your popup window when you create it.
Read the section about owned windows here for reference: https://learn.microsoft.com/en-us/windows/win32/winmsg/window-features
-SM
Create a usual main window, then try calling this function:
SetWindowLongPtr( my_main_window, GWLP_HWNDPARENT, (LONG_PTR)third_party_main_window);
Another approach would be to use a windows hook (WH_CALLWNDPROCRET) to reposition your popup window over the third party window whenever the third party window changes its position in the z-order. Reposition after the third party window has handled a WM_WINDOWPOSCHANGED message indicating the change.