AutoHotkey Community

It is currently May 27th, 2012, 11:07 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: February 15th, 2006, 4:16 pm 
Offline

Joined: December 18th, 2005, 5:40 pm
Posts: 234
Location: Italy - Galatro(RC)
I know that AHK allow to manage files and folders in a simple way. Maybe it will possible to make a powerfull file manager, with lots of features. I'm thinking of starting from the example in AHK documentation and developing a good file manager.
These things should be possible without more problems:
-tab browsing
-double panel
-filter files to show by assigning them a tag or by extension
-menu browsing(like my script to browse folder from a menu)
-...

The project should not be more weavy, but with 4-5 people working together in few months we can have the first vesion.
If someone is interested, post here

This is what I've done (looking at example in help file):
-browse folder and launch file
-jump to menu
-history of folders
-Go button
-address bar
-roots menu

Code:
; MAIN EXAMPLE
; The following is a working script that is more elaborate than the one near the top of this page.
; It displays the files in a folder chosen by the user, with each file assigned the icon associated with
; its type. The user can double-click a file, or right-click one or more files to display a context menu.

DriveGet, drv,List,Fixed
StringSplit, d, drv
Loop,%d0%
   {
      tem:=d%A_Index% ":\"
      Menu,drive,add,%tem%,gotoFolder
   }

; Allow the user to maximize or drag-resize the window:
Gui +Resize

; Create some buttons:
Gui, Add, Button, Default gButtonLoadFolder, Load a folder
Gui, Add, Button, x+20 gButtonClear, Clear List
Gui, Add, Button, x+20, Switch View
Gui, Add, Button, x+20, Jump To
Gui, Add, Button, x+20, Last
Gui, Add, Button, x+20 gRoot, Root

Gui,add,Edit,vaddress cblue x5 w500,
Gui,Add,Button,x+5,Go
; Create the ListView and its columns:
Gui, Add, ListView, xm r20 w700 vMyListView gMyListView, Name|In Folder|Size (KB)|Type
LV_ModifyCol(3, "Integer")  ; For sorting, indicate that the Size column is an integer.

; Create an ImageList so that the ListView can display some icons:
ImageListID1 := IL_Create(10)
ImageListID2 := IL_Create(10, 10, true)  ; A list of large icons to go with the small ones.

; Attach the ImageLists to the ListView so that it can later display the icons:
LV_SetImageList(ImageListID1)
LV_SetImageList(ImageListID2)

; Create a popup menu to be used as the context menu:
Menu, MyContextMenu, Add, Open, ContextOpenFile
Menu, MyContextMenu, Add, Properties, ContextProperties
Menu, MyContextMenu, Add, Clear from ListView, ContextClearRows
Menu, MyContextMenu, Default, Open  ; Make "Open" a bold font to indicate that double-click does the same thing.

; Display the window and return. The OS will notify the script whenever the user
; performs an eligible action:
Gui, Show
return


ButtonLoadFolder:
Gui +OwnDialogs  ; Forces user to dismiss the following dialog before using main window.
FileSelectFolder, Folder,, 3, Select a folder to read:
if not Folder  ; The user canceled the dialog.
   return
loadThisFolder()
return


ButtonClear:
LV_Delete()  ; Clear the ListView, but keep icon cache intact for simplicity.
return

ButtonSwitchView:
if not IconView
   GuiControl, +Icon, MyListView    ; Switch to icon view.
else
   GuiControl, +Report, MyListView  ; Switch back to details view.
IconView := not IconView             ; Invert in preparation for next time.
return

ButtonJumpTo:
   Gui,submit,nohide
   Menu,currentFolders,add
   Menu,currentFolders,deleteAll
   StringSplit, dir, Folder, \
   Loop,%dir0%
      {
         currentDir:=dir%A_Index%
         toAdd=%toAdd%%currentDir%\
         Menu,currentFolders,add,%toAdd%,gotoFolder
      }
   Menu,currentFolders,add,Root,Root
   Menu,currentFolders,show
return
gotoFolder:
   toAdd=
   Folder:=A_ThisMenuItem
   loadThisFolder()
return

ButtonGo:
   Gui,submit,nohide
   Folder=%address%
   loadThisFolder()
return

ButtonLast:
   StringSplit,dir_story,last10,|
   Menu,story,add
   Menu,story,deleteAll
   Loop,%dir_story0%
      {
         this_dir_Story:=dir_story%A_Index%
         Menu,story,add,%this_dir_Story%,gotoFolder
      }
   Menu,story,add,Root,Root
   Menu,story,show
return
Root:
   Menu,drive,show
return

MyListView:
if A_GuiEvent = DoubleClick  ; There are many other possible values the script can check.
{
   LV_GetText(FileName, A_EventInfo, 1) ; Get the text of the first field.
   LV_GetText(FileDir, A_EventInfo, 2)  ; Get the text of the second field.
   FileGetAttrib, Attributes, %FileDir%\%FileName%
   IfInString, Attributes, D
      {
         Folder=%FileDir%\%FileName%
         loadThisFolder()
      }
   else
      Run %FileDir%\%FileName%,, UseErrorLevel
   if ErrorLevel
      MsgBox Could not open "%FileDir%\%FileName%".
}
return

GuiContextMenu:  ; Launched in response to a right-click or press of the Apps key.
if A_GuiControl <> MyListView  ; Display the menu only for clicks inside the ListView.
   return
; Show the menu at the provided coordinates, A_GuiX and A_GuiY.  These should be used
; because they provide correct coordinates even if the user pressed the Apps key:
Menu, MyContextMenu, Show, %A_GuiX%, %A_GuiY%
return

ContextOpenFile:  ; The user selected "Open" in the context menu.
ContextProperties:  ; The user selected "Properties" in the context menu.
; For simplicitly, operate upon only the focused row rather than all selected rows:
FocusedRowNumber := LV_GetNext(0, "F")  ; Find the focused row.
if not FocusedRowNumber  ; No row is focused.
   return
LV_GetText(FileName, FocusedRowNumber, 1) ; Get the text of the first field.
LV_GetText(FileDir, FocusedRowNumber, 2)  ; Get the text of the second field.
IfInString A_ThisMenuItem, Open  ; User selected "Open" from the context menu.
   Run %FileDir%\%FileName%,, UseErrorLevel
else  ; User selected "Properties" from the context menu.
   Run Properties "%FileDir%\%FileName%",, UseErrorLevel
if ErrorLevel
   MsgBox Could not perform requested action on "%FileDir%\%FileName%".
return

ContextClearRows:  ; The user selected "Clear" in the context menu.
RowNumber = 0  ; This causes the first iteration to start the search at the top.
Loop
{
   ; Since deleting a row reduces the RowNumber of all other rows beneath it,
   ; subtract 1 so that the search includes the same row number that was previously
   ; found (in case adjacent rows are selected):
   RowNumber := LV_GetNext(RowNumber - 1)
   if not RowNumber  ; The above returned zero, so there are no more selected rows.
      break
   LV_Delete(RowNumber)  ; Clear the row from the ListView.
}
return

GuiSize:  ; Allows the ListView to grow or shrink in response user's resizing of window.
if A_EventInfo = 1  ; The window has been minimized.  No action needed.
   return
; Otherwise, the window has been resized or maximized. Resize the ListView to match.
GuiControl, Move, MyListView, % "W" . (A_GuiWidth - 20) . " H" . (A_GuiHeight - 40)
return

GuiClose:  ; When the window is closed, exit the script automatically:
ExitApp

loadThisFolder()
   {
      global
         last10=%Folder%|%last10%
         LV_Delete()
         GuiControl,Text,address,%Folder%
         ; Check if the last character of the folder name is a backslash, which happens for root
         ; directories such as C:\. If it is, remove it to prevent a double-backslash later on.
         StringRight, LastChar, Folder, 1
         if LastChar = \
            StringTrimRight, Folder, Folder, 1  ; Remove the trailing backslash.
         
         ; Ensure the variable has enough capacity to hold the longest file path. This is done
         ; because ExtractAssociatedIconA() needs to be able to store a new filename in it.
         VarSetCapacity(Filename, 260)
         
         ; Gather a list of file names from the selected folder and append them to the ListView:
         Loop %Folder%\*.*,1
         {
            FileName := A_LoopFileFullPath  ; Must save it to a writable variable for use below.
         
            ; Build a unique extension ID to avoid characters that are illegal in variable names,
            ; such as dashes.  This unique ID method also performs better because finding an item
            ; in the array does not require search-loop.
            SplitPath, FileName,,, FileExt  ; Get the file's extension.
            if FileExt = EXE
            {
               ExtID = EXE  ; Special ID as a placeholder.
               IconNumber = 0  ; Flag it as not found so that EXEs can each have a unique icon.
            }
            else  ; Non-EXE, so calculate this extension's unique ID.
            {
               ExtID = 0  ; Initializize to handle extensions that are shorter than others.
               Loop 7     ; Limit the extension to 7 characters so that it fits in a 64-bit value.
               {
                  StringMid, ExtChar, FileExt, A_Index, 1
                  if not ExtChar  ; No more characters.
                     break
                  ; Derive a Unique ID by assigning a different bit position to each character:
                  ExtID := ExtID | (Asc(ExtChar) << (8 * (A_Index - 1)))
               }
               ; Check if this file extension already has an icon in the ImageLists. If it does,
               ; several calls can be avoided and loading performance is greatly improved,
               ; especially for a folder containing hundreds of files:
               IconNumber := IconArray%ExtID%
            }
            if not IconNumber  ; There is not yet any icon for this extension, so load it.
            {
               ; Get the icon associated with this file extension:
               hIcon := DllCall("Shell32\ExtractAssociatedIconA", UInt, 0, Str, FileName, UShortP, iIndex)
               if not hIcon  ; Failed to load/find icon.
                  IconNumber = 9999999  ; Set it out of bounds to display a blank icon.
               else
               {
                  ; Add the HICON directly to the small-icon and large-icon lists.
                  ; Below uses +1 to convert the returned index from zero-based to one-based:
                  IconNumber := DllCall("ImageList_ReplaceIcon", UInt, ImageListID1, Int, -1, UInt, hIcon) + 1
                  DllCall("ImageList_ReplaceIcon", UInt, ImageListID2, Int, -1, UInt, hIcon)
                  ; Now that it's been copied into the ImageLists, the original should be destroyed:
                  DllCall("DestroyIcon", Uint, hIcon)
                  ; Cache the icon to save memory and improve loading performance:
                  IconArray%ExtID% := IconNumber
               }
            }
         
            ; Create the new row in the ListView and assign it the icon number determined above:
            LV_Add("Icon" . IconNumber, A_LoopFileName, A_LoopFileDir, A_LoopFileSizeKB, FileExt)
         }
         LV_ModifyCol()  ; Auto-size each column to fit its contents.
         LV_ModifyCol(3, 60) ; Make the Size column at little wider to reveal its header.
      return
   }

_________________
____________________
______________________
kiu - www.romeosa.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2006, 12:46 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Nice proposal. On a related note, I've often wanted a better "Search Results" window that's fast like Windows 2000's (for some reason, XP's is very slow and has that annoying tendency to refresh/re-search each time a file is added into the search path). One of the tricky parts would be reproducing Explorer's right-click context menu exactly (that is, customized for each file type).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2006, 8:12 am 
Offline

Joined: February 9th, 2006, 6:17 pm
Posts: 11
Do you plan this AHKExplorer to be a norton commander-like tool? I cannot imagine my work at computer without using a dual panel file explorer, but I haven't bought Total Commander. That's why I 'm using the free Turbo Navigator, and autohotkey to enhance its fetaures, because it lacks some. (for example shift-f4: create a new text file)

Well a pure autohotkey total commander would be great, if i can help, you can rely on me. To tell the truth, I don't have too much spare time, and quite rookie to autohotkey, but i am interested in taking part in a project like this.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2006, 1:01 pm 
Offline

Joined: December 18th, 2005, 5:40 pm
Posts: 234
Location: Italy - Galatro(RC)
The program should look "like" this.
Todo:
-menu File|Edit|.....
-Status bar on bottom
-context menus
-dragging support
-search option
-...(How many things can be done in AHK? :wink: )

Image

_________________
____________________
______________________
kiu - www.romeosa.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2008, 1:08 pm 
Offline

Joined: February 27th, 2008, 12:15 am
Posts: 10
It would support multi-panel and drag&drop between the panels.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 9th, 2008, 12:28 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Here is my script manager with some quite useful functions, give it a try.

Script Manager Forum

_________________

AHK -----> Almighty - Hotkeyable - Kernel


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Thumbnail view?
PostPosted: September 8th, 2008, 10:16 pm 
Offline

Joined: September 8th, 2008, 8:38 pm
Posts: 33
Any hints of how to have the AHK Explorer show a Thumbnail view instead of the Icon view?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2008, 10:32 pm 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
It might be possible through DllCall:
http://www.codeguru.com/cpp/controls/li ... .php/c899/

_________________
"Anything worth doing is worth doing slowly." - Mae West
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2008, 10:49 pm 
Offline

Joined: September 8th, 2008, 8:38 pm
Posts: 33
Serenity wrote:
It might be possible through DllCall:

I'd like to display the same thumbnails that Windows Explorer displays. E.g., AutoCAD or Revit thumbnails, not something that reads images and shows a smaller version of them.

Certainly, it would use DllCall but I have no clue how to do it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2008, 6:29 am 
Offline

Joined: May 28th, 2008, 2:11 am
Posts: 739
Location: Minnesota, USA
If you want to get pictures that shortcut files use, you can use FileGetShortcut
If the file is an exe you can just set it to the icon
For default file pictures you can get a ton of them in the registry under HKEY_CLASSES_ROOT\AppName.ext\DefaultIcon for example:
HKEY_CLASSES_ROOT\IrfanView.jpg\DefaultIcon is set to C:\Program Files\IrfanView\i_view32.exe,0
HKEY_CLASSES_ROOT\inffile\DefaultIcon is set to %SystemRoot%\System32\shell32.dll,-151

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2008, 6:51 am 
Hello guys there is no ability to delete files. :?:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2008, 8:27 am 
Code:
; MAIN EXAMPLE
; The following is a working script that is more elaborate than the one near the top of this page.
; It displays the files in a folder chosen by the user, with each file assigned the icon associated with
; its type. The user can double-click a file, or right-click one or more files to display a context menu.

DriveGet, drv,List,Fixed
StringSplit, d, drv
Loop,%d0%
   {
      tem:=d%A_Index% ":\"
      Menu,drive,add,%tem%,gotoFolder
   }

; Allow the user to maximize or drag-resize the window:
Gui +Resize

; Create some buttons:
Gui, Add, Button, Default gButtonLoadFolder, Load a folder
Gui, Add, Button, x+20 ,Up
Gui, Add, Button, x+20 gButtonClear, Clear List
Gui, Add, Button, x+20, Switch View
Gui, Add, Button, x+20, Jump To
Gui, Add, Button, x+20, Last
Gui, Add, Button, x+20 gRoot, Root

Gui,add,Edit,vaddress cblue x5 w500,
Gui,Add,Button,x+5,Go
; Create the ListView and its columns:
Gui, Add, ListView, xm r20 w700 vMyListView gMyListView, Name|In Folder|Size (KB)|Type
LV_ModifyCol(3, "Integer")  ; For sorting, indicate that the Size column is an integer.

; Create an ImageList so that the ListView can display some icons:
ImageListID1 := IL_Create(10)
ImageListID2 := IL_Create(10, 10, true)  ; A list of large icons to go with the small ones.

; Attach the ImageLists to the ListView so that it can later display the icons:
LV_SetImageList(ImageListID1)
LV_SetImageList(ImageListID2)

; Create a popup menu to be used as the context menu:
Menu, MyContextMenu, Add, Open, ContextOpenFile
Menu, MyContextMenu, Add, Properties, ContextProperties
Menu, MyContextMenu, Add, Clear from ListView, ContextClearRows
Menu, MyContextMenu, Add, Delete, ContextDeleteFile
Menu, MyContextMenu, Default, Open  ; Make "Open" a bold font to indicate that double-click does the same thing.

; Display the window and return. The OS will notify the script whenever the user
; performs an eligible action:
Gui, Show
return


ButtonLoadFolder:
Gui +OwnDialogs  ; Forces user to dismiss the following dialog before using main window.
FileSelectFolder, Folder,, 3, Select a folder to read:
if not Folder  ; The user canceled the dialog.
   return
loadThisFolder()
return


ButtonClear:
LV_Delete()  ; Clear the ListView, but keep icon cache intact for simplicity.
return

ButtonSwitchView:
if not IconView
   GuiControl, +Icon, MyListView    ; Switch to icon view.
else
   GuiControl, +Report, MyListView  ; Switch back to details view.
IconView := not IconView             ; Invert in preparation for next time.
return

ButtonJumpTo:
   Gui,submit,nohide
   Menu,currentFolders,add
   Menu,currentFolders,deleteAll
   StringSplit, dir, Folder, \
   Loop,%dir0%
      {
         currentDir:=dir%A_Index%
         toAdd=%toAdd%%currentDir%\
         Menu,currentFolders,add,%toAdd%,gotoFolder
      }
   Menu,currentFolders,add,Root,Root
   Menu,currentFolders,show
return
gotoFolder:
   toAdd=
   Folder:=A_ThisMenuItem
   loadThisFolder()
return

ButtonGo:
   Gui,submit,nohide
   Folder=%address%
   loadThisFolder()
return

ButtonLast:
   StringSplit,dir_story,last10,|
   Menu,story,add
   Menu,story,deleteAll
   Loop,%dir_story0%
      {
         this_dir_Story:=dir_story%A_Index%
         Menu,story,add,%this_dir_Story%,gotoFolder
      }
   Menu,story,add,Root,Root
   Menu,story,show
return
Root:
   Menu,drive,show
return

MyListView:
if A_GuiEvent = DoubleClick  ; There are many other possible values the script can check.
{
   LV_GetText(FileName, A_EventInfo, 1) ; Get the text of the first field.
   LV_GetText(FileDir, A_EventInfo, 2)  ; Get the text of the second field.
   FileGetAttrib, Attributes, %FileDir%\%FileName%
   IfInString, Attributes, D
      {
         Folder=%FileDir%\%FileName%
         loadThisFolder()
      }
   else
      Run %FileDir%\%FileName%,, UseErrorLevel
   if ErrorLevel
      MsgBox Could not open "%FileDir%\%FileName%".
}
return

GuiContextMenu:  ; Launched in response to a right-click or press of the Apps key.
if A_GuiControl <> MyListView  ; Display the menu only for clicks inside the ListView.
   return
; Show the menu at the provided coordinates, A_GuiX and A_GuiY.  These should be used
; because they provide correct coordinates even if the user pressed the Apps key:
Menu, MyContextMenu, Show, %A_GuiX%, %A_GuiY%
return

ContextDeleteFile:
ContextOpenFile:  ; The user selected "Open" in the context menu.
ContextProperties:  ; The user selected "Properties" in the context menu.
; For simplicitly, operate upon only the focused row rather than all selected rows:
FocusedRowNumber := LV_GetNext(0, "F")  ; Find the focused row.
if not FocusedRowNumber  ; No row is focused.
   return
LV_GetText(FileName, FocusedRowNumber, 1) ; Get the text of the first field.
LV_GetText(FileDir, FocusedRowNumber, 2)  ; Get the text of the second field.
IfInString A_ThisMenuItem, Open  ; User selected "Open" from the context menu.
   Run %FileDir%\%FileName%,, UseErrorLevel
Else IfInString A_ThisMenuItem, Delete
{
   FileDelete, %FileDir%\%FileName%
   loadThisFolder()
}
else  ; User selected "Properties" from the context menu.
   Run Properties "%FileDir%\%FileName%",, UseErrorLevel
if ErrorLevel
   MsgBox Could not perform requested action on "%FileDir%\%FileName%".
return

ContextClearRows:  ; The user selected "Clear" in the context menu.
RowNumber = 0  ; This causes the first iteration to start the search at the top.
Loop
{
   ; Since deleting a row reduces the RowNumber of all other rows beneath it,
   ; subtract 1 so that the search includes the same row number that was previously
   ; found (in case adjacent rows are selected):
   RowNumber := LV_GetNext(RowNumber - 1)
   if not RowNumber  ; The above returned zero, so there are no more selected rows.
      break
   LV_Delete(RowNumber)  ; Clear the row from the ListView.
}
return

GuiSize:  ; Allows the ListView to grow or shrink in response user's resizing of window.
if A_EventInfo = 1  ; The window has been minimized.  No action needed.
   return
; Otherwise, the window has been resized or maximized. Resize the ListView to match.
GuiControl, Move, MyListView, % "W" . (A_GuiWidth - 20) . " H" . (A_GuiHeight - 40)
return

ButtonUp:
   Gui,submit,nohide
   Folder := RegExReplace(address,"[^\\]+\\?$")
   loadThisFolder()
return

GuiClose:  ; When the window is closed, exit the script automatically:
ExitApp

loadThisFolder()
   {
      global
         last10=%Folder%|%last10%
         LV_Delete()
         GuiControl,Text,address,%Folder%
         ; Check if the last character of the folder name is a backslash, which happens for root
         ; directories such as C:\. If it is, remove it to prevent a double-backslash later on.
         StringRight, LastChar, Folder, 1
         if LastChar = \
            StringTrimRight, Folder, Folder, 1  ; Remove the trailing backslash.
         
         ; Ensure the variable has enough capacity to hold the longest file path. This is done
         ; because ExtractAssociatedIconA() needs to be able to store a new filename in it.
         VarSetCapacity(Filename, 260)
         
         ; Gather a list of file names from the selected folder and append them to the ListView:
         Loop %Folder%\*.*,1
         {
            FileName := A_LoopFileFullPath  ; Must save it to a writable variable for use below.
         
            ; Build a unique extension ID to avoid characters that are illegal in variable names,
            ; such as dashes.  This unique ID method also performs better because finding an item
            ; in the array does not require search-loop.
            SplitPath, FileName,,, FileExt  ; Get the file's extension.
            if FileExt = EXE
            {
               ExtID = EXE  ; Special ID as a placeholder.
               IconNumber = 0  ; Flag it as not found so that EXEs can each have a unique icon.
            }
            else  ; Non-EXE, so calculate this extension's unique ID.
            {
               ExtID = 0  ; Initializize to handle extensions that are shorter than others.
               Loop 7     ; Limit the extension to 7 characters so that it fits in a 64-bit value.
               {
                  StringMid, ExtChar, FileExt, A_Index, 1
                  if not ExtChar  ; No more characters.
                     break
                  ; Derive a Unique ID by assigning a different bit position to each character:
                  ExtID := ExtID | (Asc(ExtChar) << (8 * (A_Index - 1)))
               }
               ; Check if this file extension already has an icon in the ImageLists. If it does,
               ; several calls can be avoided and loading performance is greatly improved,
               ; especially for a folder containing hundreds of files:
               IconNumber := IconArray%ExtID%
            }
            if not IconNumber  ; There is not yet any icon for this extension, so load it.
            {
               ; Get the icon associated with this file extension:
               hIcon := DllCall("Shell32\ExtractAssociatedIconA", UInt, 0, Str, FileName, UShortP, iIndex)
               if not hIcon  ; Failed to load/find icon.
                  IconNumber = 9999999  ; Set it out of bounds to display a blank icon.
               else
               {
                  ; Add the HICON directly to the small-icon and large-icon lists.
                  ; Below uses +1 to convert the returned index from zero-based to one-based:
                  IconNumber := DllCall("ImageList_ReplaceIcon", UInt, ImageListID1, Int, -1, UInt, hIcon) + 1
                  DllCall("ImageList_ReplaceIcon", UInt, ImageListID2, Int, -1, UInt, hIcon)
                  ; Now that it's been copied into the ImageLists, the original should be destroyed:
                  DllCall("DestroyIcon", Uint, hIcon)
                  ; Cache the icon to save memory and improve loading performance:
                  IconArray%ExtID% := IconNumber
               }
            }
         
            ; Create the new row in the ListView and assign it the icon number determined above:
            LV_Add("Icon" . IconNumber, A_LoopFileName, A_LoopFileDir, A_LoopFileSizeKB, FileExt)
         }
         LV_ModifyCol()  ; Auto-size each column to fit its contents.
         LV_ModifyCol(3, 60) ; Make the Size column at little wider to reveal its header.
      return
   }


guys i add 2 new options
1st Up Button
2nd Delete Context Menu

is it OK?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2008, 3:31 pm 
Offline

Joined: September 8th, 2008, 8:38 pm
Posts: 33
ars wrote:
...guys i add 2 new options
1st Up Button
2nd Delete Context Menu

is it OK?

Up Button: I had to make sure the Dir has a \ at the end for the RegExReplace to work. (Folder=%FileDir%\%FileName%\) Thus:
Code:
MyListView:
if A_GuiEvent = DoubleClick  ; There are many other possible values the script can check.
{
   LV_GetText(FileName, A_EventInfo, 1) ; Get the text of the first field.
   LV_GetText(FileDir, A_EventInfo, 2)  ; Get the text of the second field.
   FileGetAttrib, Attributes, %FileDir%\%FileName%
   IfInString, Attributes, D
      {
         Folder=%FileDir%\%FileName%\
         loadThisFolder()
      }
   else
      Run %FileDir%\%FileName%,, UseErrorLevel
   if ErrorLevel
      MsgBox Could not open "%FileDir%\%FileName%".
}
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2010, 11:23 pm 
Offline

Joined: September 26th, 2007, 11:18 pm
Posts: 101
Chris wrote:
Nice proposal. On a related note, I've often wanted a better "Search Results" window that's fast like Windows 2000's (for some reason, XP's is very slow and has that annoying tendency to refresh/re-search each time a file is added into the search path). One of the tricky parts would be reproducing Explorer's right-click context menu exactly (that is, customized for each file type).



A slight offtopic, but you might try Everything search tool. quicker than thought.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 24th, 2010, 8:09 pm 
nice project
something close to xplorer2 program from zabkat would be great


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Edd, Exabot [Bot], Google Feedfetcher, HotkeyStick and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group