행위

"Autoit 현재커셔 텍스트 읽기"의 두 판 사이의 차이

DB CAFE

 
29번째 줄: 29번째 줄:
 
EndFunc  ;==>Terminate
 
EndFunc  ;==>Terminate
 
</source>
 
</source>
[[category:autoit]]
+
[[category:rpa]]

2023년 1월 26일 (목) 19:04 기준 최신판

thumb_up 추천메뉴 바로가기


HotKeySet("{ESC}", "Terminate")

While 1
    Sleep(500)
    GetControlFocus()
WEnd

Func GetControlFocus()
    Local $hWinHandle = WinGetHandle("[Active]")
    Local $sControl = ControlGetFocus($hWinHandle)

    Local $sText = "The active window handle is: " & $hWinHandle & @CRLF

    If $sControl <> "" Then
        $sText &= "The control with focus in the active window is: " & $sControl & @CRLF
        Local $aPos = ControlGetPos($hWinHandle, "", $sControl)
        $sText &= "Mouse position: X: " & $aPos[0] & " Y: " & $aPos[1] & @CRLF & "Size: " & $aPos[2] & ", " & $aPos[3]

    Else
        $sText &= "The active window is not giving focus to a control that AutoIt recognizes."
    EndIf

    ToolTip($sText, 0, 0)
EndFunc   ;==>GetControlFocus

Func Terminate()
    Exit
EndFunc   ;==>Terminate