Advertisement
Najeebsk

SEARCH-FOLDERS.ahk

Jul 24th, 2022
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #warn
  2. #noenv
  3. setworkingdir,%a_scriptdir%
  4. SetBatchLines, -1
  5. SetKeyDelay,50,50
  6.  
  7.  
  8. dir1 = %A_WorkingDir%
  9. Gui,2:default
  10. Gui,2: -DPIScale
  11. Gui,2:Font,s14 , Verdana
  12. Gui,2:Color,Black,Black
  13. wa:=A_screenwidth,ha:=A_screenHeight,xx:=100,
  14. T1:=(wa*0)/xx,T2:=(wa*25)/xx,T3:=(wa*0)/xx,T4:=(wa*9)/xx  ;- columns-width
  15.  
  16. x:=(wa*1)/xx,y:=(ha*2)/xx,w:=(wa*36)/xx,h:=(ha*4)/xx
  17.   Gui 2:Add, Edit,x%x% y%y% w%w% h%h% vfind cYELLOW gSearch
  18. x:=(wa*1)/xx,y:=(ha*7)/xx,w:=(wa*36)/xx,h:=(ha*80)/xx
  19.   Gui,2: Add , ListView, x%x% y%y% w%w% h%h% backgroundGray cYellow grid vLV1 gLV1a altsubmit Multi, #|%dir1%|Fullpath|Date
  20.   LV_ModifyCol(1,T1),LV_ModifyCol(2,T2),LV_ModifyCol(3,T3),LV_ModifyCol(4,T4),LV_ModifyCol(1,"integer"),LV_ModifyCol(2,"left"),LV_ModifyCol(4,"digit"),LV_ModifyCol(4, "left")
  21. x:=(wa*2)/xx,y:=(ha*2)/xx,w:=(wa*38)/xx,h:=(ha*90)/xx
  22.   Gui,2: Show,x%x% y%y% w%w% h%h%,LISTVIEW show folders
  23. GuiControl,2: Focus,Find
  24. gosub,fill
  25. return
  26. ;---------------------
  27. 2Guiclose:
  28. exitapp
  29. ;----------------------------
  30.  
  31. ;------------------
  32. Search:
  33. Gui,2:default
  34. Gui,2:Submit, Nohide
  35. if find=
  36.    goto,fill
  37. Gui,2:ListView, LV1
  38. ib=0
  39. row := []
  40. LV_Delete()
  41. loop,files,%dir1%\*,D
  42. {
  43.    ib++
  44.    z:=A_LoopFileFullPath
  45.    z1:=a_loopfilename
  46.    row := []
  47.    if instr(z1,find)
  48.      {
  49.      row.push(ib,z1,z,a_loopfiletimemodified)
  50.      LV_add("",row*)   
  51.      row := []
  52.      }
  53. }
  54. LV_ModifyCol(4, "Logical SortDesc")
  55. return
  56. ;----------------
  57. Fill:
  58. Gui,2:default
  59. Gui,2:Submit, Nohide
  60. Gui,2:ListView, LV1
  61. ib=0
  62. row := []
  63. LV_Delete()
  64. GuiControl,2: -Redraw,LV1
  65. loop,files,%dir1%\*,D
  66. {
  67.    ib++
  68.    z:=A_LoopFileFullPath
  69.    z1:=a_loopfilename
  70.    row := []
  71.    row.push(ib,z1,z,a_loopfiletimemodified)
  72.    LV_add("",row*) 
  73.    row := []
  74. }
  75. GuiControl,2: +Redraw,LV1
  76. LV_ModifyCol(4, "Logical SortDesc")
  77. sleep,500
  78. GuiControl,2: Focus,Find
  79. return
  80. ;----------------
  81. LV1a:
  82. Gui,2: Submit, Nohide
  83. Gui,2:ListView, LV1
  84. RC:=LV_GetNext("C")
  85. RF:=LV_GetNext("F")
  86. GC:=LV_GetCount()
  87.   If A_GuiEvent=Normal
  88.      {
  89.      LV_GetText(C3,A_EventInfo,3)
  90.      if (c3="C:\System Volume Information")
  91.        run,::{20d04fe0-3aea-1069-a2d8-08002b30309d}
  92.      else if ((c3="C:\Documents and settings") or (c3="C:\Dokumente und Einstellungen"))  ;- english and german
  93.        run,C:\users\%a_username%\Documents
  94.      else if (c3="C:\$Recycle.Bin")
  95.        run,::{645ff040-5081-101b-9f08-00aa002f954e}
  96.      else
  97.         run,%c3%
  98.      return
  99.      }
  100. return
  101. ;==========================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement