Skip to content
조회 수 16568 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

#ifwinactive & #ifwinexist  윈도우창 마다 핫키의 용도를 다르게 사용하는 방법

참고주소 : http://www.autohotkey.com/docs/commands/_IfWinActive.htm


아래의 내용을 분석해 보자면,


메모장, 워드패드, 두 창이 아닌 다른 윈도우창 일 경우 각각 ^!C가 수행되는 결과가 다르다.

즉, ^!C( {ctrl}+{alt}+C} 의 역할이 윈도우마다 다른 결과를 보이도록 하는 것이다.




Variant (Duplicate) Hotkeys

A particular hotkey or hotstring can be defined more than once in the script if each definition has different #IfWin criteria. These are known as hotkey variants. For example:

#IfWinActive ahk_class Notepad
^!c::MsgBox You pressed Control+Alt+C in Notepad.
#IfWinActive ahk_class WordPadClass
^!c::MsgBox You pressed Control+Alt+C in WordPad.
#IfWinActive
^!c::MsgBox You pressed Control+Alt+C in a window other than Notepad/WordPad.


 


그럼 이를 조금 다르게 응용해 보자면,



첫번째는 노트패드 윈도우 창이 액티브 상황에서 ^!C( {ctrl}+{alt}+C} 핫키를 실행시키면 

You pressed Control+Alt+C in Notepad. 를 메시지 띄운 다음, 노트패드 메시지를 다시 띄운다.


두번째는 워드패드 윈도우 창이 액티브되면 바로,

You pressed Control+Alt+C in WordPad. 를 메시지 띄운 다음, 워드패드 메시지를 다시 띄운다.


세번째는 노트패드, 워드패드 이외의 창에서 ^!C( {ctrl}+{alt}+C} 핫키를 실행시키면 

You pressed Control+Alt+C in a window other than Notepad/WordPad. 를 메시지 띄운다.





#IfWinActive ahk_class Notepad

{

^!c::

MsgBox You pressed Control+Alt+C in Notepad. 

msgbox 노트패드

return

}


#IfWinActive ahk_class WordPadClass

{

MsgBox You pressed Control+Alt+C in WordPad.

msgbox 워드패드

return

}


#IfWinActive

^!c::MsgBox You pressed Control+Alt+C in a window other than Notepad/WordPad.                          

 


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

?

  1. 30
    Mar 2011
    17:18

    정보수집

    CategoryAutoHotKey Views16103
    Read More
  2. 17
    Feb 2011
    07:17

    WinMenuSelectItem로 메뉴선택하기

    CategoryAutoHotKey Views16308
    Read More
  3. 14
    Feb 2011
    22:36

    #ifwinactive & #ifwinexist 윈도우창 마다 핫키의 용도를 다르게 사용하는 방법

    CategoryAutoHotKey Views16568
    Read More
  4. 02
    Aug 2011
    16:39

    [AHK_L] 현재 열려진 인터넷 창 값 가져오기

    CategoryAutoHotKey Views16592
    Read More
  5. 09
    Feb 2011
    19:28

    PostMessage로 한글 사용하기

    CategoryAutoHotKey Views16817
    Read More
  6. 22
    Feb 2011
    01:31

    ahk_l 웹페이지 파일로 저장한 뒤 불러와 필요한 부분 추출하여 출력하기

    CategoryAutoHotKey Views17005
    Read More
  7. 10
    Feb 2011
    08:21

    AHK_L 예제소스

    CategoryAutoHotKey Views17039
    Read More
  8. 22
    Feb 2011
    01:15

    ahk_l 과 com 의 이해

    CategoryAutoHotKey Views17508
    Read More
  9. 22
    Feb 2011
    01:22

    ahk_l 웹페이지 앞, 뒤페이지 제어 예제소스 및 설명첨부

    CategoryAutoHotKey Views17565
    Read More
  10. 11
    Feb 2011
    15:50

    autohotkey와 autohotkey_l 의 인터넷 창 띄우기 비교예제

    CategoryAutoHotKey Views17782
    Read More
  11. 09
    Feb 2011
    19:14

    부팅 완료 체크

    CategoryAutoHotKey Views17874
    Read More
  12. 10
    Feb 2011
    22:57

    AutoHotkey COM Standard Library

    CategoryAutoHotKey Views18058
    Read More
  13. 16
    Feb 2011
    07:05

    [ahk_l] 섬세한 인터넷 자동검색

    CategoryAutoHotKey Views18195
    Read More
  14. 09
    Feb 2011
    19:27

    com.ahk

    CategoryAutoHotKey Views18267
    Read More
  15. 05
    Feb 2011
    08:19

    [autohotkey] FTP-업로드 예제분석

    CategoryAutoHotKey Views18654
    Read More
  16. 31
    Dec 2011
    08:32

    autohotkey) 핑테스트 프로그램

    CategoryAutoHotKey Views18962
    Read More
  17. 16
    Feb 2011
    06:30

    [ahk] 다른 프로그램의 트레이 아이콘을 숨기기

    CategoryAutoHotKey Views19041
    Read More
  18. 21
    Feb 2011
    23:55

    COM 사용

    CategoryAutoHotKey Views19080
    Read More
  19. 30
    Dec 2011
    19:09

    autohotkey) IPv6 모두 사용안함 설정하기

    CategoryAutoHotKey Views19142
    Read More
  20. 11
    Feb 2011
    17:31

    AHK에서 가능한 COM 인터넷 익스플로러 및 GUI 브라우저

    CategoryAutoHotKey Views19516
    Read More
Board Pagination Prev 1 2 3 4 Next
/ 4

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소