简体   繁体   中英

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.

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). Visit pinvoke.net for the declarations.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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