본문 바로가기

Code/Study

[AutoHotkey] SetTimer & PostMessage

"메모장 정보" 창이 뜰 때 마다 "확인" 버튼을 자동으로 클릭해주는 예제

#Persistent

BM_CLICK := 245

SetTitleMatchMode, Regex
OnExit, ExitSub
SetTimer, MyLabel, 1000
return

MyLabel:
PostMessage, BM_CLICK , 0, 0, Button1, 메모장 정보
return

ExitSub:
SetTimer, MyLabel, Off
ExitApp ; The only way for an OnExit script to terminate itself is to use ExitApp in the OnExit subroutine.



#Persistent

WM_CLOSE := 0x10
WM_COMMAND := 0x111
BM_CLICK := 0XF5

SetTitleMatchMode, Regex
OnExit, ExitSub
SetTimer, MyLabel, 5000
return

MyLabel:
PostMessage, WM_COMMAND , 0X41, 0, , 메모장
Sleep, 1000
PostMessage, BM_CLICK , 0, 0, Button1, 메모장 정보
return

ExitSub:
SetTimer, MyLabel, Off
ExitApp


'Code > Study' 카테고리의 다른 글

[PerlNET] Regex (Perl C# Mix)  (0) 2008.11.09
[Perl] Cocoa (pl pm sample)  (0) 2008.11.09
[PerlNET] CIty (Mix Perl & C#)  (0) 2008.11.09
[Perl] BeeConverter (Convert HTML Entity to Unicode Character)  (0) 2008.11.09
[C/C++ vs C#] static (1)  (0) 2008.07.16