'Explorer' theme for ListViews & TreeViews on Vista+

Helpful script writing tricks and HowTo's
just me
Posts: 4793
Joined: 02 Oct 2013, 08:51
Location: Germany

'Explorer' theme for ListViews & TreeViews on Vista+

16 Jul 2015, 03:01

Related: viewtopic.php?f=13&t=8685

As long as it isn't implemented, you might want to use this function or similar:

Code: [Select all] [Download] GeSHi © Codebox Plus

SetExplorerTheme(HCTL) { ; HCTL : handle of a ListView or TreeView control
If (DllCall("GetVersion", "UChar") > 5) {
VarSetCapacity(ClassName, 1024, 0)
If DllCall("GetClassName", "Ptr", HCTL, "Str", ClassName, "Int", 512, "Int")
If (ClassName = "SysListView32") || (ClassName = "SysTreeView32")
Return !DllCall("UxTheme.dll\SetWindowTheme", "Ptr", HCTL, "WStr", "Explorer", "Ptr", 0)
}
Return False
}
Remaining with AHK 1.1.25.02 until v2 will become beta.
tmplinshi
Posts: 1091
Joined: 01 Oct 2013, 14:57

Re: 'Explorer' theme for ListViews & TreeViews on Vista+

17 Jul 2015, 03:58

For who also want to remove the listview's selection border:

Reference: http://stackoverflow.com/questions/2691726/how-can-i-remove-the-selection-border-on-a-listviewitem

Code: [Select all] [Download] GeSHi © Codebox Plus

LV_RemoveSelBorder(HLV, a*) {
Static WM_CHANGEUISTATE := 0x127
, WM_UPDATEUISTATE := 0x128
, UIS_SET := 1
, UISF_HIDEFOCUS := 0x1
, wParam := (UIS_SET << 16) | (UISF_HIDEFOCUS & 0xffff) ; MakeLong
, _ := OnMessage(WM_UPDATEUISTATE, "LV_RemoveSelBorder")
If (a.2 = WM_UPDATEUISTATE)
Return 0 ; Prevent alt key from restoring the selection border
PostMessage, WM_CHANGEUISTATE, wParam, 0,, % "ahk_id " . HLV
}
Fords

Re: 'Explorer' theme for ListViews & TreeViews on Vista+

14 Aug 2017, 04:50

Hello just me,

Is it possible to hide columns lines line like in explorer? -grid has no effect.
http://i.imgur.com/WA9w7WL.png

Thanks
User avatar
SKAN
Posts: 310
Joined: 29 Sep 2013, 16:58

Re: 'Explorer' theme for ListViews & TreeViews on Vista+

16 Sep 2017, 15:55

Wonderful selection effect when in lististview's Icon-view.
Thanks for sharing!

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 4 guests