Jump to content

ControlGetState


ivan
 Share

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'
   EndIf
   $lState = ControlCommand($pWinHndl, '', $pCtrlId, "IsEnabled", "")
   If $lState = 1 Then
      $lControlState[2] = 'IsEnabled'
   ElseIf $lState = 0 Then
      $lControlState[2] = 'IsDisabled'
   EndIf
   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.

IVAN

Edited by ivan
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...