C++ SetWindowPos Problems adjusting window topping

RL Chen 170 信誉分
2024-04-02T00:22:44.52+00:00

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);
Windows API - Win32
Windows API - Win32
一组适用于桌面和服务器应用程序的核心 Windows 应用程序编程接口 (API)。 以前称为 Win32 API。
43 个问题
C++
C++
一种通用的高级编程语言,作为 C 编程语言的扩展而创建,除了用于低级别内存操作的功能外,还具有面向对象、泛型和功能性等特点。
67 个问题
{count} 票