ControlID erkennen

  • hallo, ich haette da gerne mal eine Frage... :hammer:

    gesucht: ControlID in einer Fremdanwendung
    gegeben: ein dynamischer Text (jedes mal anders)

    Schwierigkeit:
    AutoIT Window Info zeigt leider nichts an, auch wenn man das entsprechende Objekt mit der Maus versucht anzuklicken.

    Kennt sich jemand aus?
    Danke @Berti

  • hallo peethebee, :rofl_devil:
    es scheint ein edit oder label zu sein, das die erreichte Punktzahl anzeigt.
    AutoIT Window Info zeigt leider nichts an, auch wenn man das entsprechende Objekt mit der Maus versucht anzuklicken.

    Gruss @Berti

    • Offizieller Beitrag

    Hi,

    vielleicht hilft dies:

    Spoiler anzeigen
    [autoit]

    ;~ Return values
    ;~ [N][1] = 'Title of Window'
    ;~ [N][2] = 'Handle of Window'
    ;~ [N][3] = 'Text of Window'
    ;~ [N][4] = 'Window Pos X'
    ;~ [N][5] = 'Window Pos y'
    ;~ [N][6] = 'Window ClientSize Width
    ;~ [N][7] = 'Window ClientSize Height
    ;~ [N][8] = 'Window Class List

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $aWinArray = _WinGetInfoByPID('Deineexe.exe')
    If IsArray($aWinArray) Then
    For $i = 1 To UBound($aWinArray, 1) - 1
    MsgBox(64, 'Info:', 'The title of window ' & $i & ' is: ' & @CR & $aWinArray[$i][1] & @CR & @CR & _
    'The handle of window ' & $i & ' is: ' & @CR & $aWinArray[$i][2] & @CR & @CR & _
    'The text of window ' & $i & ' is: ' & @CR & $aWinArray[$i][3] & @CR & @CR & _
    'The X Screen Pos of window ' & $i & ' is: ' & @CR & $aWinArray[$i][4] & @CR & @CR & _
    'The Y Screen Pos of window ' & $i & ' is: ' & @CR & $aWinArray[$i][5] & @CR & @CR & _
    'The Client Width of window ' & $i & ' is: ' & @CR & $aWinArray[$i][6] & @CR & @CR & _
    'The Client Height of window ' & $i & ' is: ' & @CR & $aWinArray[$i][7] & @CR & @CR & _
    'The Class List for window ' & $i & ' is: ' & @CR & $aWinArray[$i][8])
    Next
    Else
    MsgBox(64, 'Info:', 'Executable Not Found')
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Func _WinGetInfoByPID($sExe)
    Local $aPList = ProcessList(), $iPID
    For $iiCount = 1 To $aPList[0][0]
    If $aPList[$iiCount][0] = $sExe Then
    $iPID &= $aPList[$iiCount][1] & Chr(01)
    EndIf
    Next
    $iPID = StringSplit($iPID, Chr(01))
    If $iPID = 0 Then Return SetError(1, 0, 0)
    Local $aStoreHwndAndText[2][9], $nCount = 1
    $OptWSC = Opt('WinSearchChildren', 1)
    $OptWDHT = Opt('WinDetectHiddenText', 1)
    Local $aWinList = WinList()
    For $iCount = 1 To $aWinList[0][0]
    For $xCount = 1 To $iPID[0]
    If WinGetProcess($aWinList[$iCount][1]) = $iPID[$xCount] And _
    $aWinList[$iCount][0] <> '' Then
    Local $aWinPos = WinGetPos($aWinList[$iCount][1])
    Local $aWinClient = WinGetClientSize($aWinList[$iCount][1])
    $nCount += 1
    ReDim $aStoreHwndAndText[$nCount][9]
    $aStoreHwndAndText[$nCount - 1][1] = $aWinList[$iCount][0]
    $aStoreHwndAndText[$nCount - 1][2] = $aWinList[$iCount][1]
    $aStoreHwndAndText[$nCount - 1][3] = WinGetText($aWinList[$iCount][1])
    $aStoreHwndAndText[$nCount - 1][4] = $aWinPos[0]
    $aStoreHwndAndText[$nCount - 1][5] = $aWinPos[1]
    $aStoreHwndAndText[$nCount - 1][6] = $aWinClient[0]
    $aStoreHwndAndText[$nCount - 1][7] = $aWinClient[1]
    $aStoreHwndAndText[$nCount - 1][8] = WinGetClassList($aWinList[$iCount][1])
    EndIf
    Next
    Next
    Opt('WinSearchChildren', $OptWSC)
    Opt('WinDetectHiddenText', $OptWDHT)
    If $nCount = 1 Then Return SetError(2, 0, 0)
    Return $aStoreHwndAndText
    EndFunc ;==>_WinGetInfoByPID

    [/autoit]

    So long,

    Mega

  • hallo , :hm:
    danke fuer die Anregungen. Das Script funktioniert leider nicht.

    Gibt es eine Funktion, die alle ControlID's des aktuellen Fensters auflisted?

    Gruss @Berti

    2 Mal editiert, zuletzt von bertizwo (27. Februar 2007 um 12:37)

  • hallo AutoIT-Gemeinde, :keks:
    es ist mir nun doch geglückt, alle ControlID`s
    des gerade markierten Fensters anzuzeigen.


    Für meine Zwecke reicht das. Aber es scheint noch ein Unterfenster mit einigen Label's zu geben.
    AutoITWindowInfo zeigt diese Label leider nicht an.

    Wie komme ich an diese Daten?

    Danke @Berti

    3 Mal editiert, zuletzt von bertizwo (3. März 2007 um 14:05)