ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: AutoHotKey solution for Desktop ListView

(1/3) > >>

guerillablood:
Hi all!

I'm looking for an a way to emulate the function of this freeware.

Preferably something that would run at the start of a script and could be toggled on and off. It'd also be great if I could integrate it into my own AHK script, if possible. I know there is already an AHK script called DesktopHomes that does this, even though I plundered through the source, I couldn't find the bit of code for the function that I want.

Thanks in advance!

skwire:
Preferably something that would run at the start of a script and could be toggled on and off. It'd also be great if I could integrate it into my own AHK script, if possible.-guerillablood (March 22, 2014, 07:43 PM)
--- End quote ---

Here you go.


--- Code: Autohotkey ---LV_VIEW_ICON      := 0 ; DefaultLV_VIEW_DETAILS   := 1 ; Flat font and columns don't work right.LV_VIEW_SMALLICON := 2 ; Correct font, columns are okay.LV_VIEW_LIST      := 3 ; Flat font and columns are too far apart.LV_VIEW_TILE      := 4 ; Flat font, columns are okay, and there is extra text detail.LVM_SETVIEW       := 0x108ELVM_GETVIEW       := 0x108F #1::{    If ( Toggle ) ; LV_VIEW_SMALLICON & LV_VIEW_TILE work the best.    {        ControlGet, myDesktopWindow, HWND,, SysListView321, ahk_class Progman        SendMessage, % LVM_SETVIEW, % LV_VIEW_SMALLICON, 0, , % "ahk_id " . myDesktopWindow    }    Else ; Set back to default.    {        ControlGet, myDesktopWindow, HWND,, SysListView321, ahk_class Progman        SendMessage, % LVM_SETVIEW, % LV_VIEW_ICON, 0, , % "ahk_id " . myDesktopWindow    }    Toggle := !Toggle}Return
Here are some screenshots showing the different modes under a Windows 8 VM:

LV_VIEW_ICON
DONE: AutoHotKey solution for Desktop ListView

LV_VIEW_DETAILS
DONE: AutoHotKey solution for Desktop ListView

LV_VIEW_SMALLICON
DONE: AutoHotKey solution for Desktop ListView

LV_VIEW_LIST
DONE: AutoHotKey solution for Desktop ListView

LV_VIEW_TILE
DONE: AutoHotKey solution for Desktop ListView

IainB:
That's rather nifty.     :up:

guerillablood:
Thank you so much Skwire! Your work never ceases to impress. It's a shame that LV_VIEW_DETAILS doesn't function properly, but LV_VIEW_SMALLICON functions perfectly, just as I wanted!

Skwire, I don't suppose you could provide an efficient method of having a scheme run at the start of the script and have the hotkey toggle be reversed so it reverts to the default setting, could you? Or just syntax to get the list view to execute with a script?

skwire:
Thank you so much Skwire! Your work never ceases to impress. It's a shame that LV_VIEW_DETAILS doesn't function properly, but LV_VIEW_SMALLICON functions perfectly, just as I wanted!-guerillablood (March 23, 2014, 11:50 PM)
--- End quote ---

Actually, when you think about it, LV_VIEW_DETAILS does function properly.  That is, in details mode in Windows Explorer, you only ever get one column.

Skwire, I don't suppose you could provide an efficient method of having a scheme run at the start of the script and have the hotkey toggle be reversed so it reverts to the default setting, could you? Or just syntax to get the list view to execute with a script?-guerillablood (March 23, 2014, 11:50 PM)
--- End quote ---

Add the following at the top of your script before the first "Return":


--- Code: Autohotkey ---DesktopToggle := TrueToggleDesktopView( DesktopToggle )
Then add the following hotkey and function somewhere else in the script:


--- Code: Autohotkey ---#1::{    DesktopToggle := !DesktopToggle    ToggleDesktopView( DesktopToggle )}Return ToggleDesktopView( _Toggle ){    LV_VIEW_ICON      := 0 ; Default    LV_VIEW_DETAILS   := 1 ; Flat font and columns don't work right.    LV_VIEW_SMALLICON := 2 ; Correct font, columns are okay.    LV_VIEW_LIST      := 3 ; Flat font and columns are too far apart.    LV_VIEW_TILE      := 4 ; Flat font, columns are okay, and there is extra text detail.    LVM_SETVIEW       := 0x108E    LVM_GETVIEW       := 0x108F    If ( _Toggle ) ; LV_VIEW_SMALLICON & LV_VIEW_TILE work the best.    {        ControlGet, myDesktopWindow, HWND,, SysListView321, ahk_class Progman        SendMessage, % LVM_SETVIEW, % LV_VIEW_SMALLICON, 0, , % "ahk_id " . myDesktopWindow    }    Else ; Set back to default.    {        ControlGet, myDesktopWindow, HWND,, SysListView321, ahk_class Progman        SendMessage, % LVM_SETVIEW, % LV_VIEW_ICON, 0, , % "ahk_id " . myDesktopWindow    }}

Navigation

[0] Message Index

[#] Next page

Go to full version