Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Internet Explorer获得焦点时如何获得通知_C#_.net_Active Window - Fatal编程技术网

C# Internet Explorer获得焦点时如何获得通知

C# Internet Explorer获得焦点时如何获得通知,c#,.net,active-window,C#,.net,Active Window,我正在做一个项目,在这个项目中,当Internet Explorer获得焦点或在选项卡中导航时,我希望我的程序得到通知。为了更清楚,当IE实例获得焦点或用户选择另一个选项卡时,我希望我的程序得到通知 正如我在上一个问题中提到的,我只是尝试使用自动聚焦ChangedEventHandler来实现这一点:。但它似乎无法与选项卡交互正常工作 (我之前的问题似乎很具体,所以我试着让它更一般) 所以我想知道,当Internet explorer获得焦点或用户在同一IE实例中选择不同的选项卡时,是否有一种方

我正在做一个项目,在这个项目中,当Internet Explorer获得焦点或在选项卡中导航时,我希望我的程序得到通知。为了更清楚,当IE实例获得焦点或用户选择另一个选项卡时,我希望我的程序得到通知

正如我在上一个问题中提到的,我只是尝试使用
自动聚焦ChangedEventHandler
来实现这一点:。但它似乎无法与选项卡交互正常工作

(我之前的问题似乎很具体,所以我试着让它更一般)

所以我想知道,当Internet explorer获得焦点或用户在同一IE实例中选择不同的选项卡时,是否有一种方法可以通知我的应用程序

或者,如果它仍然非常具体,有什么方法可以在焦点改变时通知我的程序吗?

是一个类似的应用程序。看看是否有帮助

//This Function is used to get Handle for Active Window...
[System.Runtime.InteropServices.DllImport("user32.dll", CharSet=System.Runtime.InteropServices.CharSet.Auto)]
private static extern IntPtr GetForegroundWindow();

public static IntPtr getforegroundWindow()
{
    //This method is used to get Handle for Active Window using GetForegroundWindow() method present in  
    user32.dll
    return GetForegroundWindow();
}

你的应用程序是一个独立的进程,而不是浏览器插件,对吗?