ezi*_*zio 6 vb.net winapi topmost
我想检查外部应用程序的窗口(扑克在线游戏桌)何时跳过所有其他窗口,因为轮到我玩了.
问题是Game表跳转到前台......但是窗口不会成为活动状态......这意味着我无法通过API GetForegroundWindow检查它是否被跳过了所有其他可见窗口(并且在fatc中)此API继续返回上一个窗口的句柄,如果它是在跳过所有桌面窗口的游戏表之下).此外,GetTopWindow API不起作用.
现在的问题是:如果它没有激活,如何找到顶部可见窗口的句柄(在我眼睛的所有其他打开的窗口上的窗口)?
不,窗口不是TopMost窗口:事实上,如果我点击另一个窗口,它会进入后台.如果它应该是TopMost窗口,它将保持在顶部.
可能它是由WM_SHOW或WM_NOACTIVATE标志放在前台.
扑克应用程序必须使用 Win32 API,例如SetForegroundWindow(hWnd)
在轮到您时将窗口置于顶部。
为了检测此类调用,您可以使用Windbg 脚本跟踪 API 调用
您可以使用它从 Windbg 屏幕查看应用程序正在使用的 API,而无需使用其他工具。如果您需要 API 的更多详细信息,只需执行 LogViewer.exe 并打开使用此脚本时自动创建的 .lgv 文件。
输出文件,扩展名为 .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.
$$ ====================================
Run Code Online (Sandbox Code Playgroud)
一旦您掌握了所有这些信息,您就会知道要从特定调用者/DLL/等中查找哪些 API 调用,这时候就轮到您了,扑克窗口位于顶部,您可以使用此知识库文章来查找句柄最顶层窗口的