Skip to content
AutoHotKey
2011.02.10 08:21

AHK_L 예제소스

조회 수 17015 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

AHK_L 예제소스




■ 표준입출력 

; ---- stdout.ahk ---- 
stdout := FileOpen(DllCall("GetStdHandle""int", -11, "ptr"), "`n"
Loop, 10 
    stdout.WriteLine(A_Index . "항목"
; ---- stdin.ahk ---- 
stdin := FileOpen(DllCall("GetStdHandle""int", -10, "ptr"), "`n"
While !stdin.AtEOF() 
    q .= stdin.ReadLine() 
MsgBox, % q 

사용예) 스크립트가 위치한 디렉토리에서 cmd로 다음과 같이 실행 
> set ahk="C:\Program Files\AutoHotkey\AutoHotkey.exe" 
> %ahk% stdout.ahk | %ahk% stdin.ahk 


■ 메뉴에 아이콘 표시 

Loop, 3 { 
    Menu, M1, Add, 항목%A_Index%, Dummy 
    Menu, M1, Icon, 항목%A_Index%, %A_WinDir%\Explorer.exe, %A_Index% ; , 32|64 

Menu, M1, Show 
Dummy: 
Return 

※ 주석을 제거하고 32나 64를 지정하면 큰 아이콘도 표시 가능 


■ 탐색기에서 선택중인 파일의 풀패스를 복사 
    COM을 사용하므로 특수 폴더가 있어도 가능 

SetTitleMatchMode, RegEx 
#IfWinActive, ahk_class CabinetWClass|ExploreWClass 
#c:: 
FileList:= 
For window in ComObjCreate("Shell.Application").Windows 
    If (window.hwnd == WinExist()) { 
        For item in window.document.SelectedItems 
        FileList .= item.path "`n" 
        Break 
    } 
Clipboard:=FileList, window:=item:= 
Return 


■ 활성화된 어플리케이션의 실행파일이 위치한 폴더를 열기 

#z:: ; Win + z 
WinGet, pid, PID, A 
For process in ComObjGet("winmgmts:").ExecQuery("SELECT * FROM Win32_Process WHERE ProcessId='" pid "'"
    Run, % "explorer.exe /select`,""" . (process.ExecutablePath) . """" 
process := 
Return 


■ IE 자동화 

ie := ComObjCreate("InternetExplorer.Application"
ie.Visible := True 
ie.Navigate("http://www.google.co.kr/"
While ie.Busy() 
    Sleep, 50 
MsgBox, 로드 완료`n`n폼에 문자를 입력합니다. 
form := ie.document.GetElementsByTagName("FORM")[0] 
form.q.value := "AutoHotkey" 
MsgBox, 폼 송신 완료 
form.submit() 
While ie.Busy() 
    Sleep, 50 
MsgBox, 검색결과가 표시되었습니다.`n`n종료합니다. 
form:="" 
ie.Quit() ; 종료시키지 않으면 iexplore.exe 프로세스가 남으므로 주의 


■ AutoHotkey.dll을 이용한 멀티스레드 

미리 AutoHotkey.dll를 다운로드하여, 모듈등록을 할 필요가 있음 
(DLL이 있는 디렉토리에서 "regsvr32.exe AutoHotkey.dll"을 실행) 

code := "#NoTrayIcon`nMsgBox, Thread #" 
Loop, 10 { 
    ComObjCreate("AutoHotkey.Script").AhkTextDll(code . A_Index) 
    Sleep, 100 
}

로그인 후 댓글쓰기가 가능합니다.

?

List of Articles
번호 분류 제목 날짜 조회 수
27 AutoHotKey [AHK_B&AHK_L] 익스플로러 HTML 문서정보 알아내기(IE HTML Element Spy) 2011.08.08 15160
26 AutoHotKey autohotkey) 웹페이지의 프레임 내용보기 & 클릭하기 2011.11.29 15147
25 AutoHotKey autohotkey) 네 코드를 보여, 내가 당신에게서 배우고 싶어요 1 2012.01.08 15114
24 AutoHotKey autohotkey) 맥어드레스 추출 2 2011.12.21 15057
23 AutoHotKey autohotkey) 파일리스트 가져오기 3 2012.11.26 14980
22 AutoHotKey [ahk] 레지스터리 등록여부 확인 후 없으면 추가시키기 2 1 2011.02.14 14977
21 AutoHotKey [ahk]웹페이지가 띄워진 창 내용을 추출하여 로딩이 완료되었는지를 확인할 수 있는 소스 2011.02.25 14747
20 AutoHotKey 클릭해서 새창열리는 페이지에 클릭 또는 값설정 가능한가요? 2011.02.22 14723
19 컴퓨터잡담 IE 훅킹 혹은 가로채기. 강좌 2 2011.12.17 14604
18 AutoHotKey 웹페이지의 내용을 변수에 넣기 2011.02.17 14492
17 컴퓨터잡담 Ahk Standard Library Collection, 2010 Sep (+Gui) ~ Libs: 100 3 2011.10.11 14189
16 컴퓨터잡담 [AHK] COM Standard Library 1 1 2011.07.28 13588
15 컴퓨터잡담 [AHK] AutoHotkey_N, AutoHotkey.dll 1 2011.07.28 13562
14 컴퓨터잡담 AHK & my Address of Pointer and my Offset 2011.10.11 13183
13 AutoHotKey 부팅완료 메시지 프로그램 file 2011.12.17 12719
12 AutoHotKey ahk) autohotkey controlgettext 이름을 마우스커서에 졸졸 따라다니게 하기 file 2014.04.01 12182
11 AutoHotKey Ahk) ip할당 진단프로그램 file 2011.12.26 12119
10 컴퓨터잡담 autohotkey - 변수리스트(Variables and Expressions) 모음 2011.09.30 11830
9 [Docs]스프레드시트 스프레드시트 autohotkey html gmail 스마트폰 이용하여 핑로스 즉시 알림받기 file 2018.01.25 10578
8 컴퓨터잡담 AHK_L) SysListView321 컨트롤 내용 추출하기 2011.10.07 9893
Board Pagination Prev 1 2 3 4 5 Next
/ 5

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소