c#program,当用户在应用程序之间切换时获取通知

时间:2021-05-07 22:51:39

Want to hook my c# code to some windows API so that I can get a notification when the logged in user switch between windows(programs) open on the desktop

想要将我的c#代码挂钩到某些Windows API,这样当桌面(程序)之间的登录用户切换在桌面上打开时,我就可以收到通知

  • Event/Notification:- when user switch between applications. For example we have notepad,work,excel,outlook,IE open in parallel on the same desktop.
  • 事件/通知: - 当用户在应用程序之间切换时。例如,我们在同一桌面上并行打开了notepad,work,excel,outlook,IE。

Is polling the only way ? say every 5 mins- for current active window on desktop. that will not be very efficient.

轮询是唯一的方式吗?对于桌面上的当前活动窗口,每隔5分钟说一次。这不会很有效率。

I want to run this program on windowsXP.

我想在windowsXP上运行这个程序。

1 个解决方案

#1


Set up a CBT Hook.

设置CBT挂钩。

#1


Set up a CBT Hook.

设置CBT挂钩。