AH GUI file drag and

2023.03.05

REF

(하나) “; https://riptutorial.com/autohotkey/example/28159/open-a-file-through-windows-drag-n-drop

드래그 앤 드롭 이벤트를 잡는 부분은 GuiDrop 파일오전.

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