2023.03.05
REF
[1] "; https://riptutorial.com/autohotkey/example/28159/open-a-file-through-windows-drag-n--drop"
drag and drop event를 잡는 부분은 GuiDropFiles이다.
Gui, add, edit, hwndxEdit, drop file here
Gui, add, button, gbtn_ok, &OK
Gui, add, button, x+0 gbtn_exit, &Exit
Gui, show, w200 h100, gui_Test
return
btn_ok:
return
btn_exit:
ExitApp
return
GuiDropFiles:
MouseGetPos,,,,Hdrop,2
if(Hdrop=xEdit)
MsgBox,% A_GuiEvent ;the names of the files that were dropped
Gui, show,,gui_Test
return
^ESC:: ExitApp
다음 코드와 비교해보자
Gui, XXXX: 은 Gui에 이름을 부여하는 것, 여러 GUI를 동시에 만든다면 이름이 필요하겠지..
Gui, XXXX: New
Gui, add, edit, hwndxEdit, drop file here
Gui, add, button, gbtn_ok, &OK
Gui, add, button, x+0 gbtn_exit, &Exit
Gui, show, w200 h100, gui_Test
return
btn_ok:
return
btn_exit:
ExitApp
return
XXXXGuiDropFiles:
MouseGetPos,,,,Hdrop,2
if(Hdrop=xEdit)
MsgBox,% A_GuiEvent ;the names of the files that were dropped
Gui, show,,gui_Test
return
^ESC:: ExitApp
'[PA] 업무자동화 > [AH]Autohotkey' 카테고리의 다른 글
AH detecting mouse click (0) | 2023.03.10 |
---|---|
AH mutiple GUI in one script (0) | 2023.03.06 |
AH Gui control click했을 때 반응하기 (0) | 2023.03.05 |
AH GUI 메뉴 추가하기 (0) | 2023.03.05 |
AH 한명이 승인요청 중일 때 다른 사람이 요청하면 (0) | 2023.03.04 |