Check if control is currently being shown?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hellen_dorandt89
Posts: 25
Joined: 05 Jan 2022, 08:25

Check if control is currently being shown?

Post by hellen_dorandt89 » 01 Mar 2023, 14:15

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?

Return to “Ask for Help (v1)”