Jump to content

Recommended Posts

Posted

Hi all,

Is it possible to check if certain ControlID (or ClassNameNN) exists in some window (by hWnd)?

I made this function, but it's not work with all windows, for example, if we check the window of Opera Browser, then this control not found, but from the Au3Info tool you can see it...

Func _ClassIsExits($hWnd, $ClassName)
    If Not IsHWnd($hWnd) Then $hWnd = WinGetHandle($hWnd)
    If Not WinExists($hWnd) Then Return SetError(1, 0, 0)
    Local $ClassesArr = StringSplit(WinGetClassList($hWnd), @LF)
    If IsArray($ClassesArr) Then
        For $i = 1 To UBound($ClassesArr)-1
            If $ClassesArr[$i] = $ClassName Then Return True
        Next
    Else
        If $ClassesArr = $ClassName Then Return True
    EndIf
    Return False
EndFunc

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

  MsCreatoR said:

Hi all,

Is it possible to check if certain ControlID (or ClassNameNN) exists in some window (by hWnd)?

I made this function, but it's not work with all windows, for example, if we check the window of Opera Browser, then this control not found, but from the Au3Info tool you can see it...

Func _ClassIsExits($hWnd, $ClassName)
    If Not IsHWnd($hWnd) Then $hWnd = WinGetHandle($hWnd)
    If Not WinExists($hWnd) Then Return SetError(1, 0, 0)
    Local $ClassesArr = StringSplit(WinGetClassList($hWnd), @LF)
    If IsArray($ClassesArr) Then
        For $i = 1 To UBound($ClassesArr)-1
            If $ClassesArr[$i] = $ClassName Then Return True
        Next
    Else
        If $ClassesArr = $ClassName Then Return True
    EndIf
    Return False
EndFunc

Checking if " Process exists " may help ?

Posted
  Quote

Checking if " Process exists " may help ?

Thanks, but No, how this will help? :)

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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
  • Recently Browsing   0 members

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