【问题标题】:Process IsFocused .net C++ or C# [closed]处理 IsFocused .net C++ 或 C# [关闭]
【发布时间】:2012-08-28 10:57:24
【问题描述】:

如何检查 Process 对象是否集中?请用 c++ od c# 代码回复 提前致谢。

【问题讨论】:

标签: c# c++ focus


【解决方案1】:

您可以基于 GetForegroundWindow() 使用此代码

var process = GetForegroundWindow();
if (process != IntPtr.Zero) {
    return true;       // he has focus
}

【讨论】:

  • 我不想将此窗口设置为聚焦...我只想检查它是否聚焦...仅此而已
猜你喜欢
  • 1970-01-01
  • 2021-10-23
  • 2010-12-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-04-22
  • 2012-03-01
  • 2011-02-28
相关资源
最近更新 更多