문서 편집 권한이 없습니다. 다음 이유를 확인해주세요:
요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다: 사용자.
== caret을 숨기는 방법 (AutoIt + WinAPI) == {{개요 재목:AutoIt에서 **caret(캐럿, 텍스트 커서)**을 숨기려면 일반적으로 Windows API를 사용해야 합니다. * AutoIt은 기본적으로 caret 제어 기능을 직접 제공하지 않지만, DllCall을 이용하여 Windows API의 HideCaret 함수를 호출하면 가능합니다. }} <source lang=autoit> ; 활성 창에서 caret 숨기기 Local $hWnd = WinGetHandle("[ACTIVE]") ; 또는 특정 컨트롤의 hWnd DllCall("user32.dll", "int", "HideCaret", "hwnd", $hWnd) </source> * 설명 ** HideCaret(hwnd): ** hwnd는 캐럿을 숨기려는 윈도우 핸들입니다. ** 숨긴다고 해도 캐럿 자체는 존재하지만 사용자 눈에 보이지 않게 됩니다. === 다시 보이게 하려면? === <source lang=autoit> DllCall("user32.dll", "int", "ShowCaret", "hwnd", $hWnd) </source> * 참고 사항 * 이 API는 캐럿을 소유한 컨트롤에만 적용됩니다. ** 예를 들어 Edit 컨트롤 안의 캐럿을 숨기고 싶다면 그 컨트롤의 hwnd를 정확히 지정해야 합니다. ** 예를 들어 GUICtrlCreateInput()으로 만든 입력창의 캐럿을 숨기고 싶다면 ControlGetHandle()로 핸들을 가져와야 합니다. ** 예시: *:<source lang=autoit> GUICreate("Caret Hide Test", 300, 100) Local $idInput = GUICtrlCreateInput("", 10, 10, 280, 20) GUISetState() ; 캐럿 숨기기 Local $hInput = ControlGetHandle("Caret Hide Test", "", $idInput) DllCall("user32.dll", "int", "HideCaret", "hwnd", $hInput) While 1 If GUIGetMsg() = -3 Then Exit WEnd </source> === 예제 1: GUI Input 박스에서 캐럿 숨기기 === <source lang=autoit> GUICreate("Caret 숨기기 예제", 300, 120) Local $idInput = GUICtrlCreateInput("여기엔 캐럿이 없음", 10, 10, 280, 30) GUISetState() ; 캐럿 숨기기 Sleep(500) ; GUI 로딩 대기 Local $hInput = ControlGetHandle("Caret 숨기기 예제", "", $idInput) DllCall("user32.dll", "int", "HideCaret", "hwnd", $hInput) While 1 If GUIGetMsg() = -3 Then Exit WEnd </source> === 예제 2: 캐럿 숨기고 3초 후 다시 보이게 하기 === <source lang=autoit> GUICreate("캐럿 제어 예제", 300, 120) Local $idInput = GUICtrlCreateInput("캐럿이 숨겨졌다가 다시 나타납니다", 10, 10, 280, 30) GUISetState() Sleep(500) Local $hInput = ControlGetHandle("캐럿 제어 예제", "", $idInput) ; 캐럿 숨기기 DllCall("user32.dll", "int", "HideCaret", "hwnd", $hInput) Sleep(3000) ; 캐럿 다시 보이기 DllCall("user32.dll", "int", "ShowCaret", "hwnd", $hInput) While 1 If GUIGetMsg() = -3 Then Exit WEnd </source> [[category:autoit]]
문서 저장 미리 보기 차이 보기 취소