문서 편집 권한이 없습니다. 다음 이유를 확인해주세요:
요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다: 사용자.
<source lang=autoit> ; 초기 커서 위치 설정 Local $iCursorPos = StringLen(ControlGetText($hActiveWindow, "", $hFocusedControl)) ; 커서 이동 후 위치 추적 Func UpdateCursor($iMoveBy) $iCursorPos += $iMoveBy If $iCursorPos < 1 Then $iCursorPos = 1 If $iCursorPos > StringLen(ControlGetText($hActiveWindow, "", $hFocusedControl)) Then $iCursorPos = StringLen(ControlGetText($hActiveWindow, "", $hFocusedControl)) Return $iCursorPos EndFunc </source> == 커서 위치의 문자 인식 == <source lang=autoit> #include <MsgBoxConstants.au3> ; 활성 창 및 컨트롤 정보 가져오기 Local $hActiveWindow = WinGetHandle("[ACTIVE]") Local $hFocusedControl = ControlGetFocus($hActiveWindow) ; 텍스트 읽기 If $hFocusedControl <> "" Then ; 현재 컨트롤의 전체 텍스트 가져오기 Local $sText = ControlGetText($hActiveWindow, "", $hFocusedControl) ; 커서 이동 (5칸 왼쪽으로 이동) ControlSend($hActiveWindow, "", $hFocusedControl, "{LEFT 5}") ; 내부적으로 커서가 이동한 후 문자를 읽기 Local $iCursorPos = StringLen($sText) - 5 ; 현재 커서 위치를 계산 If $iCursorPos > 0 Then ; 해당 위치의 문자 추출 Local $sChar = StringMid($sText, $iCursorPos, 1) MsgBox($MB_ICONINFORMATION, "Character at Cursor", "Character at cursor: " & $sChar) Else MsgBox($MB_ICONWARNING, "Error", "Cursor is out of bounds!") EndIf Else MsgBox($MB_ICONERROR, "Error", "No focused control found!") EndIf </source> [[category:autoit]]
문서 저장 미리 보기 차이 보기 취소