mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
https://github.com/user-attachments/assets/5062d5d3-2665-4336-9639-c5531060f8f8 ## 由 Sourcery 提供的总结 优化叠加日志窗口的行为,在保持其位置和层级正确的同时,尽量减少对目标窗口的影响。 改进点: - 将单一的 WinEvent 钩子替换为一组有针对性的钩子,用于前台、最小化、显示/隐藏、销毁以及位置变更等事件,以更好地跟踪目标窗口状态。 - 引入带防抖和版本控制的叠加层位置与尺寸更新机制,以在目标窗口频繁移动或调整大小时减少重复工作。 - 调整叠加层的边距、尺寸计算逻辑以及支持 DPI 感知的像素计算,使叠加层在目标窗口区域内更加紧凑地适配。 - 新增逻辑以同步叠加层与目标窗口的可见性和 Z 轴顺序,包括正确处理最小化、隐藏和销毁等情况。 <details> <summary>Original summary in English</summary> ## Summary by Sourcery Optimize the overlay log window behavior to reduce its impact on the target window while keeping it correctly positioned and layered. Enhancements: - Replace the single WinEvent hook with a set of targeted hooks for foreground, minimize, show/hide, destroy, and location change events to better track the target window state. - Introduce debounced, versioned overlay position and size updates to minimize redundant work when the target window moves or resizes frequently. - Adjust overlay margins, sizing logic, and DPI-aware pixel calculations so the overlay fits more compactly within the target window area. - Add logic to synchronize overlay visibility and z-order with the target window, including correct handling of minimization, hiding, and destruction. </details>
45 lines
731 B
Plaintext
45 lines
731 B
Plaintext
// GpuOption
|
|
CreateDXGIFactory2
|
|
IDXGIFactory4
|
|
DXGI_ERROR_NOT_FOUND
|
|
IDXGIAdapter1
|
|
D3D12CreateDevice
|
|
ID3D12Device
|
|
S_FALSE
|
|
DisplayConfigGetDeviceInfo
|
|
DISPLAYCONFIG_ADAPTER_NAME
|
|
CM_Get_Device_Interface_Property
|
|
CM_Get_DevNode_Property
|
|
CM_Locate_DevNode
|
|
CONFIGRET
|
|
CM_LOCATE_DEVNODE_FLAGS
|
|
DEVPKEY_Device_InstanceId
|
|
DEVPKEY_Device_DriverDate
|
|
DEVPKEY_Device_DriverVersion
|
|
|
|
// Window enumeration
|
|
EnumWindows
|
|
GetForegroundWindow
|
|
GetWindowText
|
|
GetWindowTextLengthW
|
|
GetWindowThreadProcessId
|
|
IsIconic
|
|
IsWindowVisible
|
|
GetWindowRect
|
|
SetWindowPos
|
|
ShowWindow
|
|
SetWinEventHook
|
|
UnhookWinEvent
|
|
GetWindowLong
|
|
SetWindowLong
|
|
|
|
//BadInjectedDllChecker
|
|
GetModuleHandle
|
|
GetModuleFileName
|
|
|
|
//ToastNotification
|
|
FlashWindowEx
|
|
|
|
// PowerManagement
|
|
SetSuspendState
|