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.
Creating a popup window above an another.
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?
3 answers
Sort by: Newest
-
-
Viorel 112.2K Reputation points
2021-10-04T18:30:46.97+00:00 Create a usual main window, then try calling this function:
SetWindowLongPtr( my_main_window, GWLP_HWNDPARENT, (LONG_PTR)third_party_main_window);
-
SM 416 Reputation points
2021-10-04T17:01:20.867+00:00 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