Jump to content
Sign in to follow this  


Recommended Posts


One can easily retreive the state of a control as shown below:

I thought it was too basic to post in scripts and scraps, + lots of people come to this forum searching for help, so...

Func ControlGetState($pWinHndl, $pCtrlId)
   Dim $lControlState[3]
   Local $lState
   $lControlState[0] = 2
   $lState = ControlCommand($pWinHndl, '', $pCtrlId, "IsVisible", "")
   If $lState = 1 Then
      $lControlState[1] = 'IsVisible'
   ElseIf $lState = 0 Then
      $lControlState[1] = 'IsInVisible'
   $lState = ControlCommand($pWinHndl, '', $pCtrlId, "IsEnabled", "")
   If $lState = 1 Then
      $lControlState[2] = 'IsEnabled'
   ElseIf $lState = 0 Then
      $lControlState[2] = 'IsDisabled'
   Return $lControlState
EndFunc ;==>ControlGetState

oOPS, forgot to say, it retreives both visible and disabled state in a 1 dim array with 3 elements, should really have been 2 but can easily be modified.


Edited by ivan

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.