简体   繁体   English

如何检测应用程序窗口是否设置为“始终在顶部” /“最顶部”(不属于我的应用程序)?

[英]How to detect if an application window is set to 'always on top' / 'top most' (that is not part of my application)?

I am enumerating through all visible application windows on a system and I want to determine which ones are set to 'always on top' / 'top most'. 我正在枚举系统上所有可见的应用程序窗口,并想确定将哪些窗口设置为“始终位于顶部” /“最顶部”。

My application needs to determine this as it positions various third party applications on a large monitor for fast data entry. 我的应用程序需要确定这一点,因为它将各种第三方应用程序放置在大型监视器上以便快速输入数据。

I'm happy with a P/Invoke solution. 我对P / Invoke解决方案感到满意。

You'll need to P/Invoke GetWindowLongPtr() to get the extended style of the window (GWL_EXSTYLE = -20) and check if the WS_EX_TOPMOST style is turned on (0x08). 您需要P / Invoke GetWindowLongPtr()以获取窗口的扩展样式(GWL_EXSTYLE = -20),并检查WS_EX_TOPMOST样式是否已打开(0x08)。 Visit pinvoke.net for the declarations. 访问pinvoke.net以获得声明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM