What is the best way to determine if a window is actually visible in WPF

前端 未结 1 775
甜味超标
甜味超标 2021-02-20 01:19

I\'m trying to toggle the display of a small window based on the click of a notify icon in a system tray app. This is simple enough to implement, however when the small window i

相关标签:
1条回答
  • 2021-02-20 02:23

    You may not want to rely on whether a window is obstructed as there are many factors that can change the window size, positing, etc. and all of them tie into accessibility features which add even more complexities.

    Instead, you may want to check whether or not the window has focus. This is how MSN Messenger knows whether or not to flash orange in the taskbar; it fires a notification and if it doesn't have focus, the taskbar flashes.

    0 讨论(0)
提交回复
热议问题