Dragging and dropping files into Application
Declare External Functions:
1 2 3 4 |
Subroutine DragAcceptFiles(Long hWnd, Boolean fAccept) Library "shell32.dll" subroutine DragFinish(long hDrop) library "shell32.dll" Function ULong DragQueryFileW(Long hDrop, ULong iFile, Ref String szFileName, ULong cch) Library "shell32.dll" Alias For "DragQueryFileW" Function ULong DragQueryFileA(Long hDrop, ULong iFile, Ref String szFileName, ULong cch) Library "shell32.dll" Alias For "DragQueryFileA" |
Enable Drag Accept Files (event open or constructor)
1 2 |
// Enable Drag Accept Files DragAcceptFiles(Handle(lb_files), True) |
Disable Drag Accept Files (event close or destructor):
1 2 |
// Disable Drag Accept Files DragAcceptFiles(Handle(lb_files), False) |
Add custom event pbm_dropfiles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Constant ULong FILECOUNT = 4294967295 ULong lul_index, lul_chars, lul_idx, lul_max String ls_FileName ULong lul_size = 1023 //260 lul_max = DragQueryFileW(Handle, FILECOUNT, ls_FileName, lul_size) For lul_idx = 1 To lul_max lul_index = lul_idx - 1 ls_FileName = Space(lul_size) lul_chars = DragQueryFileW(Handle, lul_index, ls_FileName, lul_size) lb_files.AddItem(ls_FileName) Next DragFinish(Handle) |
Find Projects On Github click here
Good Luck!
Subscribe
Login
0 Comments
Oldest