Jump to content

How to check if a control is hidden?


mikephn
 Share

Recommended Posts

I'm automating the execution of a program. When it runs it does its thing, and then presents the results. Unfortunately, the only clear indication that it finished is that a WindowsForm10.STATIC text saying "Scanning" becomes hidden. In Window Info I can see the text moving from Visible Text to Hidden Text. However, I don't know how to tell if the control is hidden or not. How would you do it?

Alternatively, I could check if a button that allows to progress further becomes active (it's grayed out when its scanning). Is that any easier?

Link to comment
Share on other sites

Please have a look at "ControlCommand".

Example:

$iVisible = ControlCommand ( "Your window title", "text in your window (optional)", controlID, "IsVisible")
Returns 1 if Control is visible, 0 otherwise.

"IsEnabled" returns 1 if Control is enabled, 0 otherwise.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

or

#include <GUIConstantsEx.au3>
    GUICreate("My GUI Button") 
    $Button_1 = GUICtrlCreateButton("Hide Button2", 10, 30, 100,30)
    $Button_2 = GUICtrlCreateButton("Button2",10,70,100,30)
    $Button_3 = GUICtrlCreateButton("Chike Button2 Is Hide",10,110,200,30)
    GUISetState() 
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Button_1
            GUICtrlSetState ($Button_2,$GUI_HIDE)
            Case $msg = $Button_3
            $state = WinGetState(GUICtrlGetHandle($Button_2), "")
            If BitAnd($state,2) Then
            MsgBox(0, "MSG", "Button2 is Not Hide")
             Else
             MsgBox(0, "MSG", "Button2 is Hide")
            EndIf
        EndSelect
    WEnd
Exit
Edited by wolf9228

صرح السماء كان هنا

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...