Question for jeeswg

Get help with using AutoHotkey and its commands and hotkeys
Flanagens

Question for jeeswg

26 Dec 2017, 14:59

Someone on IRC said you would be the person to ask. I am on windows 10, in file explorer I only want the columns date modified and type, can a script do that so on any machine even when I reset it or some program resets it as I had, I can press the hotkey and place it back to only shows those columns (plus the file obviously, first column)

Thank you
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Question for jeeswg

26 Dec 2017, 15:55

This code should work to set the columns of the active Explorer window. You would need to the include the library (look up #Include), or functions from it, that appear in the link specified. Cheers.

Code: Select all

;Explorer column interaction (get/set: which appear, width, ascending/descending order) - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=33129

q:: ;Explorer - set active window columns to: name, date modified, type
WinGet, hWnd, ID, A
WinGetClass, vWinClass, % "ahk_id " hWnd
if !(vWinClass = "CabinetWClass") && !(vWinClass = "ExploreWClass")
	return
for oWin2 in ComObjCreate("Shell.Application").Windows
	if (oWin2.HWND = hWnd)
	{
		oWin := oWin2
		break
	}
vList := "System.ItemNameDisplay" ;Name
;vList .= "|System.ItemDate" ;Date
;vList .= "|System.Size" ;Size
;vList .= "|System.Media.Duration" ;Length
vList .= "|System.DateModified" ;Date modified
vList .= "|System.ItemTypeText" ;Type

JEE_ExpGetInterfaces(oWin, pSP, pSB, pSV, pFV2, pCM)
JEE_ICMSetColumns(pCM, vList, "|")
for _, vValue in [pCM, pFV2, pSV, pSB, pSP]
	ObjRelease(vValue)
oWin := ""
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Flanagens

Re: Question for jeeswg

26 Dec 2017, 18:42

jeeswg wrote:This code should work to set the columns of the active Explorer window. You would need to the include the library (look up #Include), or functions from it, that appear in the link specified. Cheers.

Code: Select all

;Explorer column interaction (get/set: which appear, width, ascending/descending order) - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=33129

q:: ;Explorer - set active window columns to: name, date modified, type
WinGet, hWnd, ID, A
WinGetClass, vWinClass, % "ahk_id " hWnd
if !(vWinClass = "CabinetWClass") && !(vWinClass = "ExploreWClass")
	return
for oWin2 in ComObjCreate("Shell.Application").Windows
	if (oWin2.HWND = hWnd)
	{
		oWin := oWin2
		break
	}
vList := "System.ItemNameDisplay" ;Name
;vList .= "|System.ItemDate" ;Date
;vList .= "|System.Size" ;Size
;vList .= "|System.Media.Duration" ;Length
vList .= "|System.DateModified" ;Date modified
vList .= "|System.ItemTypeText" ;Type

JEE_ExpGetInterfaces(oWin, pSP, pSB, pSV, pFV2, pCM)
JEE_ICMSetColumns(pCM, vList, "|")
for _, vValue in [pCM, pFV2, pSV, pSB, pSP]
	ObjRelease(vValue)
oWin := ""
return
works really nicely! thanks you! for anyone needing a link to the rest see here https://autohotkey.com/boards/viewtopic.php?t=33129

Return to “Ask for Help”

Who is online

Users browsing this forum: Descolada, liquidmetalrob, william_ahk and 45 guests