加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

vb.net – 在屏幕顶部找到窗口的句柄

发布时间:2020-12-17 00:08:31 所属栏目:大数据 来源:网络整理
导读:我想检查外部应用程序的窗口(扑克在线游戏桌)何时跳过所有其他窗口,因为轮到我玩了. 问题是Game表跳转到前台……但是窗口不会成为活动状态……这意味着我无法通过API GetForegroundWindow检查它是否被跳过了所有其他可见窗口(并且在fatc中)此API继续返回上一
我想检查外部应用程序的窗口(扑克在线游戏桌)何时跳过所有其他窗口,因为轮到我玩了.

问题是Game表跳转到前台……但是窗口不会成为活动状态……这意味着我无法通过API GetForegroundWindow检查它是否被跳过了所有其他可见窗口(并且在fatc中)此API继续返回上一个窗口的句柄,如果它是在跳过所有桌面窗口的游戏表之下).此外,GetTopWindow API不起作用.

现在的问题是:如果它没有激活,如何找到顶部可见窗口的句柄(在我眼睛的所有其他打开的窗口上的窗口)?

不,窗口不是TopMost窗口:事实上,如果我点击另一个窗口,它会进入后台.如果它应该是TopMost窗口,它将保持在顶部.

可能它是由WM_SHOW或WM_NOACTIVATE标志放在前台.

扑克应用程序必须使用Win32 API,例如SetForegroundWindow(hWnd),以便在轮到你时将窗口置于顶部.

为了检测这样的呼叫,您可以使用Windbg Script Tracing API calls

You can use it to see the APIs an application is using from your
Windbg screen without using another tool. If you need more details
from the APIs,just execute LogViewer.exe and open the .lgv file that
is automatically created when you use this script.

输出文件,扩展名为.LGV.

LogViewer.exe是Windows调试工具的一部分.它位于您安装Windbg的同一位置.使用LogViewer.exe打开.LGV文件:

API_TRACING.TXT的源代码:

$$
$$=============================================================================
$$Trace APIs during the Debugging Session. 
$$Creates a log on Desktop and Windbg window.
$$To see the more verbose log run logviewer.exe from Debugging Tools for Windows
$$and open the file that has the .lgv extension.
$$This file is inside LogExts on your desktop.
$$
$$Compatibility: Win32,should work on Win64.
$$
$$Usage: $$>< to run the program.
$$
$$Roberto Alexis Farah
$$Blog: blogs.msdn.com/debuggingtoolbox/
$$
$$All my scripts are provided "AS IS" with no warranties,and confer no rights.
$$=============================================================================
$$
!logexts.loge
!logexts.logc e *
!logexts.logo e v
!logexts.logb p
$$
$$====================================
$$Logging is enabled for this process.
$$====================================

获得所有这些信息之后,您将知道要从特定调用者/ DLL /等查找的API调用,这是您轮到您的时间,扑克窗口是ontop,您可以使用此知识库文章到Find the Handle of the TopMost Window

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读