获取第二个活动窗口 vb.net
我需要创建一个表单,其中当浏览器可见时 AlwaysOnTop = True
。这会创建某种“覆盖”。逻辑是这样工作的:
- 程序检查哪个窗口是活动的。
- 如果活动窗口是某个进程,我的窗体将初始化 TopMost 实用程序,并成为活动窗口本身。
- 当某个进程不再是活动窗口时,我的窗体将消失。
我是如何做到的:
- 我的程序检查浏览器是否是活动窗口,如果是:表单位于最顶层,程序停止检查活动窗口是什么。 (因为我最上面的窗体现在是活动窗口)。
- 现在程序需要检查我的窗体下的窗口是什么,第二个活动窗口。
- 如果不再是浏览器,则需要隐藏表单,程序将再次检查活动窗口是什么。
我已经完成了检查第一个活动窗口是什么的功能,
我仍然坚持获取检查第二个活动窗口是什么的功能。
I need to create a form where AlwaysOnTop = True
when the browser is visible. This creates some sort over "overlay". The logic works like this:
- The program checks which window is active.
- If the active windows is a certain process, my form will initialize the TopMost utility, and be the active window itself.
- When the certain process is not the active window anymore, my form will disappear.
How I did it:
- My program checks if a browser is the active window, if so: the form gets topmost and the program stops checking what the active window is. (because my topmost form is the active window now).
- Now the program needs to check what the window under my form is, the second active window.
- If it's not the browser anymore, the form needs to hide, and the program will check what the active window is again.
I already completed the function that checks what the first active window is,
I'm stuck on getting the function that checks what the second active window is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定是否存在“第二个活动窗口”之类的东西 - 它要么是活动的,要么不是。
在检测浏览器的第一步之后,为什么不让活动窗口检查器继续运行呢?
您可以检测活动窗口何时不再是您的表单,然后隐藏您的覆盖层。
I'm not sure that there's such as thing as a "Second active window" - its either active or its not.
Why don't your leave you active window checker running after the first step of detecting the browser.
You can detect when the active window is no longer your form and hide your overlay then.