Jump to content

Desktop -> View -> Small icons


Recommended Posts

Deye

1) Thank you very much

2) This code 100 percent work on Microsoft WIndows 7 Professional x64 Service Pack 1

#include <WinAPISys.au3>

$hWnd = ControlGetHandle('[Class:Progman]', '', '[Class:SHELLDLL_DefView]')

_Desktop_DefView_SetIconSz($hWnd, 1)

Func _Desktop_DefView_SetIconSz($hWnd, $iSize) ;$hwnd of DefView, $iSize 0-4 smallest to largest

    ;EXLARGEICONS=0, MEDICONS=1, LARGEICONS=2,SMALLICONS=3, SMALLESTICONS=4
    ;Made this up from watching Window Messages (fires menu messages I think)
    ;(IFolderView2::SetViewModeAndIconSize. is probably how WE should be doing this)
    If @OSVersion = "WIN_XP" Then Return 0
    ;Works on Windows 7/8, Sends icon size to defView based on ListView view

    If $iSize < 0 Or $iSize > 4 Or @OSVersion = "WIN_XP" Then Return 0
    Local $aLvtoDv[5] = [4, 3, 1, 2, 0]
    ;Extra Large Icons = &H704D -28749<-----Index 0
    ;Medium Icons = &H704E      -28750; Large Icons = &H704F       -28751;
    ;Small Icons = &H7050       -28752; Smallest Icons = &H7051    -28753

    Local Const $WM_COMMAND = 0x111
    Local $iMsg = $WM_COMMAND
    Local $wParam = 28749 + $aLvtoDv[Int($iSize)] ;FVM_??
    Local Const $lParam = 0
    _SendMessage($hWnd, $iMsg, $wParam, $lParam)
    If @error Then
        MsgBox(0, "_Desktop_DefView_SetIconSz", "_SendMessage Error: " & @error)
        Exit
    EndIf

    Return 1
EndFunc   ;==>_Desktop_DefView_SetIconSz

3) Question : how replace

$hWnd = ControlGetHandle('[Class:Progman]', '', '[Class:SHELLDLL_DefView]')

on

$hWnd = _WinAPI_GetDesktopWindow ( )

I find on https://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_GetDesktopWindow.htm

4) This code

#include <WinAPISys.au3>
#include <WinAPI.au3>

$hWnd = _WinAPI_GetDesktopWindow ( )

_Desktop_DefView_SetIconSz($hWnd, 1)

Func _Desktop_DefView_SetIconSz($hWnd, $iSize) ;$hwnd of DefView, $iSize 0-4 smallest to largest
...
EndFunc   ;==>_Desktop_DefView_SetIconSz

do not work

careca

Hello

This code 100 percent work on Microsoft WIndows 7 Professional x64 Service Pack 1

#include <WinAPISys.au3>

$hWnd = ControlGetHandle('[Class:Progman]', '', '[Class:SHELLDLL_DefView]')

_Desktop_DefView_SetIconSz($hWnd, 1)

Func _Desktop_DefView_SetIconSz($hWnd, $iSize) ;$hwnd of DefView, $iSize 0-4 smallest to largest

    ;EXLARGEICONS=0, MEDICONS=1, LARGEICONS=2,SMALLICONS=3, SMALLESTICONS=4
    ;Made this up from watching Window Messages (fires menu messages I think)
    ;(IFolderView2::SetViewModeAndIconSize. is probably how WE should be doing this)
    If @OSVersion = "WIN_XP" Then Return 0
    ;Works on Windows 7/8, Sends icon size to defView based on ListView view

    If $iSize < 0 Or $iSize > 4 Or @OSVersion = "WIN_XP" Then Return 0
    Local $aLvtoDv[5] = [4, 3, 1, 2, 0]
    ;Extra Large Icons = &H704D -28749<-----Index 0
    ;Medium Icons = &H704E      -28750; Large Icons = &H704F       -28751;
    ;Small Icons = &H7050       -28752; Smallest Icons = &H7051    -28753

    Local Const $WM_COMMAND = 0x111
    Local $iMsg = $WM_COMMAND
    Local $wParam = 28749 + $aLvtoDv[Int($iSize)] ;FVM_??
    Local Const $lParam = 0
    _SendMessage($hWnd, $iMsg, $wParam, $lParam)
    If @error Then
        MsgBox(0, "_Desktop_DefView_SetIconSz", "_SendMessage Error: " & @error)
        Exit
    EndIf

    Return 1
EndFunc   ;==>_Desktop_DefView_SetIconSz

 

 

Edited by SharkyEXE
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...