Magpie/tools/WindowCase/main.cpp
Xu d01956e3a7
源窗口位于前台时始终置顶缩放窗口 (#1259)
* feat: 模拟中途置顶的窗口

* fix: 按钮随 DPI 缩放

* fix: 始终置顶

* fix: 修复切换前台窗口

* feat: 删除置顶选项

* refactor: 检查逻辑

* refactor: 用更简单的方式将缩放窗口置于源窗口之前

* fix: 支持源窗口中途置顶

* refactor: 小优化

* fix: 修复特定操作下意外将源窗口置顶

* fix: 提高取消置顶的可靠性

* fix: 调试模式下不置顶

* chore: WindowCase 支持模拟弹窗

* fix: 不要把被禁用的窗口设为前台

* feat: WindowCase 支持模拟“模拟模态弹窗”

* chore: 避免大量错误日志

* fix: 优化 Z 顺序维护

* fix: 不再使用 SWP_NOOWNERZORDER

* fix: 修复消息弹窗可能影响窗口 Z 顺序

* refactor: 小优化

* chore: 添加注释

* chore: 添加注释

* fix: 小优化

* chore: 小优化
2025-08-21 17:49:05 +08:00

36 lines
706 B
C++

#include "pch.h"
#include "KirikiriWindow.h"
#include "HungWindow.h"
#include "TopmostWindow.h"
#include "PopupHostWindow.h"
int APIENTRY wWinMain(
_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE /*hPrevInstance*/,
_In_ LPWSTR /*lpCmdLine*/,
_In_ int /*nCmdShow*/
) {
// 模拟 TVP(KIRIKIRI) 2 引擎窗口
// KirikiriWindow window;
// 模拟挂起的窗口
// HungWindow window;
// 模拟中途置顶/取消置顶的窗口
// TopmostWindow window;
// 模拟有弹窗的窗口
PopupHostWindow window;
if (!window.Create(hInstance)) {
return false;
}
MSG msg;
while (GetMessage(&msg, nullptr, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int)msg.wParam;
}