Opened 14 years ago

Closed 12 years ago

#1683 closed Feature Request (Rejected)

Displaying thumbnails of files in a GUI

Reported by: Eric Owned by: Jon
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


It would be great to have a function who can get and display thumbnails of files in a GUI.

Not only JPG, BMP but PDF, DOC...



Attachments (0)

Change History (7)

comment:1 Changed 14 years ago by anonymous

GUICtrlCreateIcon() works just fine.
Search the forum for possible UDF's in this area.

comment:2 Changed 14 years ago by Eric

GUICtrlCreateIcon works fine for icons but not for thumbnails.

comment:3 Changed 14 years ago by Jpm

Which API can be used to display thumbnails?

comment:4 Changed 14 years ago by Eric

I don't know but i have found a method who works for Windows XP but not for Windows 7.

comment:5 Changed 14 years ago by Jpm

  • Owner set to Jon
  • Status changed from new to assigned

comment:6 Changed 12 years ago by guinness

Your request can be achieved by using the following example.

#include <APIConstants.au3> ; Download from
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WinAPIEx.au3> ; Download from

Local $iIcon

GUICreate("", 128, 128)
$iIcon = GUICtrlCreateIcon("", 0, 48, 48, 32, 32)
_Icon_Set($iIcon, @ScriptFullPath)



Func _Icon_Clear($iControlID)
    Local Const $STM_SETIMAGE = 0x0172

    If $iControlID = -1 Then
        $iControlID = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($iControlID))
    Return GUICtrlSendMsg($iControlID, $STM_SETIMAGE, $IMAGE_ICON, 0)
EndFunc   ;==>_Icon_Clear

Func _Icon_Set($iControlID, $sFilePath) ; Idea initially from Yashied.
    Local Const $STM_SETIMAGE = 0x0172
    Local $hIcon, $tInfo

    If $iControlID = -1 Then
        $iControlID = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($iControlID))
    $tInfo = DllStructCreate($tagSHFILEINFO)
    _WinAPI_ShellGetFileInfo($sFilePath, BitOR($SHGFI_ICON, $SHGFI_LARGEICON), 0, $tInfo)
    $hIcon = DllStructGetData($tInfo, 'hIcon')
    Return _WinAPI_DestroyIcon(GUICtrlSendMsg($iControlID, $STM_SETIMAGE, $IMAGE_ICON, $hIcon))
EndFunc   ;==>_Icon_Set

comment:7 Changed 12 years ago by trancexx

  • Resolution set to Rejected
  • Status changed from assigned to closed

The accent is on using UDFs.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Jon.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.