다른 명령
새 문서: <source lang=sql> HotKeySet("{ESC}", "_Mouse_Exit_App") Global $i_Mouse_Is_Down = False Global $i_Mouse_Primary = 0x01 ; 0x01 = left for primary, 0x02 = right Global $a_hMouseMod_hTimer = _Mouse_StartWatch("_Mouse_GetHighlight_ToClipboard", 0, 10001, 1000) While 1 Sleep(100) WEnd Func _Mouse_GetHighlight_ToClipboard() If Not $i_Mouse_Is_Down Then Local $a_GetAsync = DllCall("User32.dll", "int", "GetAsyncKeyState", "int", $i_Mouse_Primary) If... |
잔글 개발노트 양식 일괄 적용 |
||
| 1번째 줄: | 1번째 줄: | ||
{{개발노트 | |||
|요약= | |||
|핵심= | |||
|분야=Autoit | |||
|작성일=2024-10-04 | |||
}} | |||
<source lang=sql> | <source lang=sql> | ||
HotKeySet("{ESC}", "_Mouse_Exit_App") | HotKeySet("{ESC}", "_Mouse_Exit_App") | ||
2026년 11월 12일 (목) 12:46 기준 최신판
DEVCAFE NOTE
AutoitKEY POINTS · 핵심 정리
HotKeySet("{ESC}", "_Mouse_Exit_App")
Global $i_Mouse_Is_Down = False
Global $i_Mouse_Primary = 0x01 ; 0x01 = left for primary, 0x02 = right
Global $a_hMouseMod_hTimer = _Mouse_StartWatch("_Mouse_GetHighlight_ToClipboard", 0, 10001, 1000)
While 1
Sleep(100)
WEnd
Func _Mouse_GetHighlight_ToClipboard()
If Not $i_Mouse_Is_Down Then
Local $a_GetAsync = DllCall("User32.dll", "int", "GetAsyncKeyState", "int", $i_Mouse_Primary)
If Not @error And BitAND($a_GetAsync[0], 0x8000) = 0x8000 Then
$i_Mouse_Is_Down = True
While Not @error And BitAND($a_GetAsync[0], 0x8000) = 0x8000
Sleep(50)
$a_GetAsync = DllCall("User32.dll", "int", "GetAsyncKeyState", "int", $i_Mouse_Primary)
WEnd
Send("^{Insert}")
Sleep(100)
$i_Mouse_Is_Down = False
EndIf
EndIf
Return 1
EndFunc
Func _Mouse_StartWatch($sCallback_Func, $hWnd, $iEvent_ID, $iEvent_Time)
Local $h_Mouse_Mod = DllCallbackRegister($sCallback_Func, "int", "")
If @error Then Return SetError(@error, 1, 0)
Local $h_Timer = DllCall("User32.dll", "int", "SetTimer", _
"hwnd", $hWnd, _
"int", $iEvent_ID, _
"int", $iEvent_Time, _
"ptr", DllCallbackGetPtr($h_Mouse_Mod))
If @error Then Return SetError(@error, 2, 0)
Local $aRet[2] = [$h_Mouse_Mod, $h_Timer[0]]
Return $aRet
EndFunc
Func _Mouse_StopWatch(ByRef $h_Mouse_Mod, ByRef $h_Timer, $hWnd = 0)
If $h_Mouse_Mod > 0 Then
DllCallbackFree($h_Mouse_Mod)
$h_Mouse_Mod = 0
EndIf
If $h_Timer > 0 Then
DllCall("User32.dll", "int", "KillTimer", "hwnd", $hWnd, "int", $h_Timer)
If @error Then Return SetError(@error, 0, 0)
$h_Timer = 0
EndIf
Return 1
EndFunc
Func _Mouse_Exit_App()
_Mouse_StopWatch($a_hMouseMod_hTimer[0], $a_hMouseMod_hTimer[1])
Exit
EndFunc