CAFE

파워빌더 TIP

[TIP]윈도우 탐색기에 있는 파일을 Drag-Drop으로 파워빌더로 가져오기

작성자파빌신|작성시간11.08.12|조회수475 목록 댓글 0

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 가 있다고 가정함.. */

다음검색
현재 게시글 추가 기능 열기

댓글

댓글 리스트
맨위로

카페 검색

카페 검색어 입력폼