| 发表于:2007-07-16 20:00:456楼 得分:25 |
option explicit dim ispause as boolean, issearch as boolean, isstop as boolean private sub form_load() list1.oledropmode = 1 restorepublic end sub private sub list1_oledragdrop(data as dataobject, effect as long, button as integer, shift as integer, x as single, y as single) list1.clear dim t as integer, ti as integer 'on error resume next for t = 1 to data.files.count if data.getformat(vbcffiles) then list1.additem data.files(t) if getattr(data.files(t)) and vbdirectory then seacheruserdir data.files(t), true end if next t end sub private sub seacheruserdir(byval strpath as string, optional byval ischecksub as boolean = true) ' '原作者:chenhui530 于 2007-3-17 21:55 static sum as long dim strfolders() as string, dirs as integer, i as integer if right(strpath, 1) <> "\ " then strpath = strpath & "\ " dim strtmp as string on error resume next strtmp = dir(strpath & "*.* ", 1 or 2 or 4 or vbdirectory) do while strtmp <> " " sum = sum + 1 if sum mod 20 = 0 then doevents if getattr(strpath & strtmp) and vbdirectory then if left(strtmp, 1) <> ". " then form1.list1.additem strpath & strtmp 'sendmessage form1.list1.hwnd, wm_vscroll, sb_bottom, 0& redim preserve strfolders(0 to dirs) strfolders(dirs) = strpath & strtmp & "\ " dirs = dirs + 1 end if else form1.list1.additem strpath & strtmp 'sendmessage form1.list1.hwnd, wm_vscroll, sb_bottom, 0& end if strtmp = dir loop if not ischecksub then exit sub for i = 0 to dirs - 1 if isstop then issearch = false: exit for seacheruserdir strfolders(i), ischecksub next end sub private sub restorepublic() isstop = false ispause = false issearch = false end sub | | |
|