C++ SetWindowPos Problems adjusting window topping
RL Chen
170
信誉分
With the following code, I am trying to place window A
at the top and then window B
underneath window A
. The Z sequence should be Top -> A -> B
. But now I have a problem, for example, if a full screen window O
appears, the Z sequence becomes Top -> O -> A -> B
, and when I execute the code again, it becomes Top -> A -> O -> B
, not Top -> A -> B -> O
as I expected. This problem is probable, and I don't know the exact trigger reason, so I hope that someone can help me solve it. I hope someone can help me to solve this problem, thanks!
SetWindowPos(HwndA, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
SetWindowPos(HwndB, HwndA, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);