【问题标题】:Is there a way to verify that the current window of another program is totally visible?有没有办法验证另一个程序的当前窗口是否完全可见?
【发布时间】:2009-08-13 02:44:59
【问题描述】:

是否有任何功能,或者我必须遍历我前面的所有窗口并检测它们是否与我的窗口重叠?

谢谢

【问题讨论】:

  • 也许您可以研究一个类似 GetUpdateRect 的 API,这样您就可以看到请求绘制的内容。或许先失效。只是一个想法,不确定它是否会导致任何结果。

标签: c++ winapi visual-c++ mfc


【解决方案1】:

您是否尝试将 GetForegroundWindow() 返回的 HWND 与您的应用程序的 HWND 进行比较? (http://msdn.microsoft.com/en-us/library/ms633505%28VS.85%29.aspx)

为了更清楚:

hwndForeground = GetForegroundWindow();
if (hwndForeground != myapp)
  //Compare if rect of (hwndForeground) is overlapping rect of (myapp)

【讨论】:

  • 我现在正在遍历我上面的所有窗口,看看它们是否相交。
猜你喜欢
  • 2011-05-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-07-28
  • 2014-09-04
  • 2021-12-21
  • 1970-01-01
相关资源
最近更新 更多