matepi
V2EX  ›  Qt

Windows 下枚举窗口并寻找指定标题窗口加以置顶,遇到类似 QT 的定制窗口无法简单取到实际标题应如何处理?

  •  
  •   matepi · Aug 4, 2020 · 5657 views
    This topic created in 2143 days ago, the information mentioned may be changed or developed.

    自己做个 JNA+Win32API 的小练手需求,做个小工具,按用户给出的字符串置顶窗口

    可以用 EnumWindows,然后 GetWindowText,获得标题,然后按用户给出字符串匹配到标题,则去置顶窗口

    但遇到一些个问题,有些软件是 QT 做的窗口(用 winspy 可以看到标题是类似 QT 之类的东西)的时候。就没有办法靠 GetWindowText 来判断标题了。对 QT 窗口以及子窗口的寻找判断、大家有什么好的做法或者建议想法?

    PS. 有点 meta 的问一句。这种问题发在 V2EX 合适?还是应该直接发去 stackoverflow ?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3000 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 14:26 · PVG 22:26 · LAX 07:26 · JFK 10:26
    ♥ Do have faith in what you're doing.