Page 1 of 1

Check if control is currently being shown?

Posted: 01 Mar 2023, 14:15
by hellen_dorandt89
I am trying to determine if a control is visible and if so take a different set of actions.

For example, in Notepad check if the status bar is currently visible:

Code: Select all

ControlGet ctrlVisible, Visible,, Windows.UI.Composition.DesktopWindowContentBridge5, a       ;"Windows.UI.Composition.DesktopWindowContentBridge5" is the status bar control name, Win11
If (ctrlVisible){
    MsgBox, found
}
Else{
    MsgBox, not found
}
The above example always triggers Found, even when I hide the status bar.

Here is attempt, I constructed this from a answer I found:

Code: Select all

If (WinExist(wintitle, "Windows.UI.Composition.DesktopWindowContentBridge5"))
    MsgBox, found
else
    MsgBox, Not found
This one is just the opposite, it always reports Not Found

Has anyone had any luck with this?