FUNCTION int DragQueryFile(long hDrop, int iFile, REF string szFileName,int cb) LIBRARY "shell32.dll"
SUBROUTINE DragAcceptFiles(long l_hWnd,boolean fAccept) LIBRARY "shell32.dll"
SUBROUTINE DragFinish(long hDrop) LIBRARY "shell32.dll"
window Open Evnet
DragAcceptFiles(handle(this), true)
User Event ue_dropfiles 생성 - EventID : pbm_dropfiles
다음과 같이 스크립트 합니다.
String ls_filename = Space(128)
Integer li_file, li_files
Ulong hDrop
hDrop = Message.WordParm
li_files = DragQueryFile(hDrop, -1, ls_filename, 127) - 1
FOR li_file = 0 TO li_files
DragQueryFile(hDrop, li_file, ls_filename, 127)
IF lb_file.FindItem(ls_filename,0) <> -1 then
MessageBox("Error in adding File", "File " + ls_filename + " already exist")
ELSE
lb_file.AddItem(ls_filename)
END IF
NEXT
DragFinish(hDrop)
/* lb_file 라는 listbox 가 있다고 가정함.. */