After migrating to Windows 10 I was keen to learn the new Explorer but don't really like the Ribbon and was disappointed that there were only two icons on the far right of the Status Bar and not my favourite, which is List view. I wrote some code so that R-clicking on these icons would give me a shortcut to two other favourite views. When I started using QTTabBar I had to revise the original code (as it had worked by getting the position in the window (bottom RH corner) of the icons) to something else which would detect the icons, no matter how many times and wherever they were repeated. After some time I found that using ImageSearch and looking for the top left 12x12 pixels of the icons, in both hover and pressed form worked well. 27px and 28px are the width and height of the full icon on the Status Bar.
I used Software: Zoom+ to copy the screen image to clipboard and then pasted into Greenfish Icon Editor Pro to edit and save top left 12x12px of the icons.
To do this on your own Win 10 system I think you will have to make your own icon files - varying on theme / resolution etc. Make two files for each icon, one for hover and one for pressed. That is 4 image files total.
Code: Select all
#IfWinActive, ahk_class CabinetWClass ; Win 10 Explorer changing View settings
*~RButton::
MouseGetPos, mX, mY, hWnd, ctrlNN, 1 ; determine where mouse is clicked
; CoordMode, Pixel, Screen ; may be needed
; CoordMode, Mouse, Screen ; may be needed
; search around where Mouse is clicked for each image
ImageSearch, CS2_X, CS2_Y, mX-27, mY-28, mX+12, mY+12, *w0 *h0 explorer-view-2h.ico ; hover icon for large thumbnails (Ctrl+Shift+2)
If not CS2_X
ImageSearch, CS2_X, CS2_Y, mX-27, mY-28, mX+12, mY+12, *w0 *h0 explorer-view-2p.ico ; pressed icon for large thumbnails (Ctrl+Shift+2)
If CS2_X
{ Tooltip, Change View to Extra Large Icons (Ctrl+Shift+1) ; can be changed to personal favourite etc
KeyWait, RButton
Send ^+1 ; correct window frame is already focused due to R Click
}
Else
{ ImageSearch, CS6_X, CS6_Y, mX-27, mY-28, mX+12, mY+12, *w0 *h0 explorer-view-6h.ico ; hover icon for details view (Ctrl+Shift+6)
If not CS6_X
ImageSearch, CS6_X, CS6_Y, mX-27, mY-28, mX+12, mY+12, *w0 *h0 explorer-view-6p.ico ; pressed icon for details view (Ctrl+Shift+6)
If CS6_X
{ Tooltip, Change to List View (Ctrl+Shift+5) ; can be changed to personal favourite etc
KeyWait, RButton
Send ^+5 ; correct window frame is already focused due to R Click
}
}
Sleep, 3000
Tooltip
Return