jeeswg's Explorer tutorial

Helpful script writing tricks and HowTo's
User avatar
jeeswg
Posts: 1265
Joined: 19 Dec 2016, 01:58
Location: UK

jeeswg's Explorer tutorial

14 May 2017, 14:27

[Note: I will be expanding the content here.]
[Note: I may add more examples in future, particularly examples with objects.]

SPECIAL FOLDERS:

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

;Run, ::{20d04fe0-3aea-1069-a2d8-08002b30309d} ;My Computer
;Run, ::{645ff040-5081-101b-9f08-00aa002f954e} ;Recycle Bin


WIN+D AND WIN+M:

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

;PostMessage, 0x111, 415,,, ahk_class Shell_TrayWnd ;WM_COMMAND ;Win+M?
;PostMessage, 0x111, 416,,, ahk_class Shell_TrayWnd ;WM_COMMAND ;Shift+Win+M? restore all
;PostMessage, 0x111, 419,,, ahk_class Shell_TrayWnd ;WM_COMMAND ;show desktop (doesn't toggle)
;PostMessage, 0x111, 407,,, ahk_class Shell_TrayWnd ;WM_COMMAND ;Win+D? show desktop toggle


WINDOWS / DIALOG BOXES:

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



CONTROL PANEL:

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



UTILITIES:

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



==================================================

EXPLORER WINDOWS (FOLDERS/SPECIAL FOLDERS/CONTROL PANEL)

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

;based on:
;Getting CLSID or SpecialFolderConstant of an Explorer object - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=5&t=4884

q:: ;get the path for folders/special folders/Control Panel items
for window in ComObjCreate("Shell.Application").Windows
try MsgBox % window.Document.Folder.Self.Path
return


==================================================

EXPLORER MENU ITEMS

[trigger Explorer menu items]
Windows 7 - invert selection, set details view/list view (trigger Explorer/Internet Explorer menu items) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=27564

==================================================

EXPLORER FOLDER WINDOW MESSAGES

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

;q:: ;Explorer folder window messages (tested on Windows 7)
ControlGet, hCtl, Hwnd,, SHELLDLL_DefView1, A

PostMessage, 0x111, 28706, 0,, % "ahk_id " hCtl ;edit, invert selection
PostMessage, 0x111, 28747, 0,, % "ahk_id " hCtl ;view, details
PostMessage, 0x111, 28753, 0,, % "ahk_id " hCtl ;view, list
PostMessage, 0x111, 28705, 0,, % "ahk_id " hCtl ;edit, select all
PostMessage, 0x111, 31492, 0,, % "ahk_id " hCtl ;view, sort by, name
return


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

;q:: ;Explorer folder window messages (tested on Windows XP)
WinGet, hWnd, ID, A

PostMessage, 0x111, 28706, 0,, % "ahk_id " hWnd ;edit, invert selection
PostMessage, 0x111, 28716, 0,, % "ahk_id " hWnd ;view, details
PostMessage, 0x111, 28715, 0,, % "ahk_id " hWnd ;view, list
PostMessage, 0x111, 28705, 0,, % "ahk_id " hWnd ;edit, select all
return


[lists of Explorer window message IDs (general comments + Windows XP constants)]
Automating Windows Explorer - Ask for Help - AutoHotkey Community
https://autohotkey.com/board/topic/5936-automating-windows-explorer/

[note: some IDs in context menus are constant, some are variable]
Get Info from Context Menu (x64/x32 compatible) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=31971

[set view mode via objects]
Reading Win 10 File Explorer View Mode - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=28304

==================================================

FILE ICONS

[show/hide hidden files, show/hide extensions (via SHGetSetSettings)]
[refresh thumbnails/icons][when icons/thumbnails out-of-date][windows 7]
Refreshing the file explorer - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=12656
AutoHotkey_L v1.1.08 - Page 3 - Announcements - AutoHotkey Community
https://autohotkey.com/board/topic/82612-autohotkey-l-v1108/page-3#entry536021

==================================================

HIDE/SHOW EXTENSIONS, HIDE/SHOW HIDDEN FILES

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



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



==================================================

HIDE/SHOW DESKTOP ICONS

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



The wParam value 29698 is from:
Show/hide desktop icons in Windows 7 - Ask for Help - AutoHotkey Community
https://autohotkey.com/board/topic/43524-showhide-desktop-icons-in-windows-7/

On Windows 7, the 'Show desktop icons' menu item ID was 30988, but this didn't work as the wParam value.

==================================================

REFRESH DESKTOP/FOLDER ICONS

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

q:: ;refresh desktop/folder icons (tested on Windows 7)
;e.g. on Desktop: icons for files no longer on Desktop, disappear
;however on Desktop: thumbnails for images inside folders not updated
;SHCNE_ASSOCCHANGED := 0x8000000
DllCall("Shell32\SHChangeNotify", Int,0x8000000, UInt,0, Ptr,0, Ptr,0)
return


AutoHotkey_L v1.1.08 - Page 3 - Announcements - AutoHotkey Community
https://autohotkey.com/board/topic/82612-autohotkey-l-v1108/page-3#entry536021

==================================================

TASKBAR + SYSTRAY (TASKBAR BUTTONS + SYSTRAY ICONS)

[list taskbar buttons + systray icons]
Windows Update: detect if important updates available - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=26727
[list taskbar windows (get hWnds)][list taskbar buttons]
Recover accidentally closed window/program - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=31704

list Recent Items (My Recent Documents) (Start Menu) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=31386
Start menu, Recent Items menu, focus first/last item - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=27560

[list information from tray icons][TrayIcon.ahk]
[LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=1229

[check for Windows updates including in systray]
Windows Update: detect if important updates available - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=26727

[move mouse to taskbar button]
Move mouse to taskbar to use AeroPeek - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=27147

==================================================

DESKTOP

get full paths of selected files on Desktop and Common File Dialogs - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=31135

==================================================

DIALOGS

[get a single Properties dialog for multiple files (that don't have to be in the same folder)]
SHMultiFileProperties - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=30483

==================================================

MORE LINKS (SEE 'SHELL - ')

best utilities + best AutoHotkey scripts (+ useful tips) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=28149

Return to “Tutorials”

Who is online

Users browsing this forum: Peared and 3 guests