feat(plugins): 截图前检测 CAD 窗口遮挡并自动置前 #7

Merged
gjm merged 2 commits from home-lenovo-legion-r9000/home-ai-dev AGit into main 2026-10-13 23:57:01 +08:00
Collaborator

get_viewport_screenshot 使用 GDI 抓屏(GetDC+BitBlt 读屏幕内容),
若 CAD 窗口被其它窗口遮挡会截到遮挡窗口。现增加:

  • IsWindowOccluded:客户区中心点经 WindowFromPoint 取顶层窗口,
    根窗口不同即判定被遮挡。
  • ForceWindowForeground:AttachThreadInput + SetWindowPos/BringWindowToTop/
    SetForegroundWindow 强制置前,RedrawWindow(RDW_UPDATENOW) 同步重绘。
  • Execute 中先检测遮挡/前台状态,必要时置前并 Sleep(120) 等 DWM 合成,
    返回文本按「已置前」「仍被遮挡」给出提示。
get_viewport_screenshot 使用 GDI 抓屏(GetDC+BitBlt 读屏幕内容), 若 CAD 窗口被其它窗口遮挡会截到遮挡窗口。现增加: - IsWindowOccluded:客户区中心点经 WindowFromPoint 取顶层窗口, 根窗口不同即判定被遮挡。 - ForceWindowForeground:AttachThreadInput + SetWindowPos/BringWindowToTop/ SetForegroundWindow 强制置前,RedrawWindow(RDW_UPDATENOW) 同步重绘。 - Execute 中先检测遮挡/前台状态,必要时置前并 Sleep(120) 等 DWM 合成, 返回文本按「已置前」「仍被遮挡」给出提示。
home-Lenovo-Legion-r9000 added 1 commit 2026-10-13 23:55:48 +08:00
get_viewport_screenshot 使用 GDI 抓屏(GetDC+BitBlt 读屏幕内容),
若 CAD 窗口被其它窗口遮挡会截到遮挡窗口。现增加:

- IsWindowOccluded:客户区中心点经 WindowFromPoint 取顶层窗口,
  根窗口不同即判定被遮挡。
- ForceWindowForeground:AttachThreadInput + SetWindowPos/BringWindowToTop/
  SetForegroundWindow 强制置前,RedrawWindow(RDW_UPDATENOW) 同步重绘。
- Execute 中先检测遮挡/前台状态,必要时置前并 Sleep(120) 等 DWM 合成,
  返回文本按「已置前」「仍被遮挡」给出提示。
home-Lenovo-Legion-r9000 added 1 commit 2026-10-13 23:56:10 +08:00
gjm merged commit e56ce09caf into main 2026-10-13 23:57:01 +08:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gjm/cad-agent#7