English 中文(简体)
我怎么能够告诉我的应用窗口是地下窗口。
原标题:How can I tell my application window is the foreground window
  • 时间:2009-10-02 07:38:42
  •  标签:

我有以下问题: 我要说的是,我的申请窗口是视窗的地窗。 我正在视窗XP使用C#, Net Framework 3.5。

我实际上可以想出两种方式来做我之后的事情。

  1. Use pinvoke, GetForeGroundWindow and compare the returned hWnd to the hWnd of my form
  2. Check if Form.ActiveForm is null or an object reference

方法1似乎是科索沃,但除非我不得不,否则我不会使用pin。 我不完全肯定的是方法2,尽管它似乎在大韩民国工作。

我应当使用哪一种方法?

最佳回答

看来,“积极”是具体应用。

如果你想要知道你的形式是否是整个非洲顾问办公室的积极形式,那么你就会与APIC和HWnd进行比较。

[System.Runtime.InteropServices.DllImport( "user32.dll" )]    
public static extern IntPtr GetForegroundWindow();
问题回答

暂无回答




相关问题
热门标签