Advertisement
Najeebsk

Win7DesktopModes.ahk

Nov 10th, 2022
1,174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; <COMPILER: v1.1.34.04>
  2. #NoEnv
  3. #SingleInstance, Force
  4. SetBatchLines, -1
  5. ;#NoTrayIcon
  6. SetWorkingDir %A_ScriptDir%  
  7. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-
  8. ;Windows 7 view modes
  9. ;menu item ID, view mode, CurrentViewMode/IconSize
  10. ;28749 E&xtra large icons - 1 256
  11. ;28751 La&rge icons - 1 96
  12. ;28750 &Medium icons - 1 48
  13. ;28752 Small ico&ns - 2 16
  14. ;28753 &List - 3 16
  15. ;28747 &Details - 4 16
  16. ;28748 Tile&s - 6 16
  17. ;28754 Conten&t - 8 32
  18.  
  19. q:: ;windows 7 - set view mode
  20. ControlGet, hCtl, Hwnd,, SHELLDLL_DefView1, A
  21. PostMessage, 0x111, 28747, 0,, % "ahk_id " hCtl ;View, Details
  22. ;PostMessage, 0x111, 28750, 0,, % "ahk_id " hCtl ;Medium icons - 1 48 Normal
  23. return
  24.  
  25. w:: ;windows 7 - set view mode
  26. WinGet, hWnd, ID, A
  27. WinGetClass, vWinClass, % "ahk_id " hWnd
  28. if !(vWinClass = "CabinetWClass") && !(vWinClass = "ExploreWClass")
  29.     return
  30. for oWin in ComObjCreate("Shell.Application").Windows
  31. {
  32.     if (oWin.HWND = hWnd)
  33.     {
  34.         ;MsgBox, % oWin.Document.CurrentViewMode " "
  35.  
  36. oWin.Document.IconSize
  37.         oWin.Document.CurrentViewMode := 4 ;View, Details
  38.         ;oWin.Document.CurrentViewMode := 3 ;View, List
  39.         oWin.Document.IconSize := 16
  40.         break
  41.     }
  42. }
  43. oWin := ""
  44. Return
  45. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  46. #R::Reload  ;<--  ~ Reload Script ~
  47. #S::Suspend ;<--  ~ Suspend Script ~
  48. #P::Pause   ;<--  ~ Pause Script ~
  49. #M::WinMinimize, ;<--  ~ Minimize Script ~
  50. ESC::ExitApp     ;<--  ~ Exit Script ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement