Modify

#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:

Description

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...

Thanks

Eric

Attachments (0)

Change History (7)

comment:1 by anonymous, on Jun 17, 2010 at 11:08:41 PM

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

comment:2 by Eric, on Jun 18, 2010 at 8:30:59 AM

GUICtrlCreateIcon works fine for icons but not for thumbnails.

comment:3 by J-Paul Mesnage, on Jun 24, 2010 at 8:36:11 AM

Which API can be used to display thumbnails?

comment:4 by Eric, on Jun 24, 2010 at 5:26:37 PM

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

http://www.autoitscript.com/forum/index.php?showtopic=113827&st=0&p=796101&fromsearch=1&#entry796101

comment:5 by J-Paul Mesnage, on Jun 28, 2010 at 6:09:43 AM

Owner: set to Jon
Status: newassigned

comment:6 by guinness, on Nov 6, 2011 at 11:57:18 PM

Your request can be achieved by using the following example.

#include <APIConstants.au3> ; Download from http://www.autoitscript.com/forum/topic/98712-winapiex-udf/
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WinAPIEx.au3> ; Download from http://www.autoitscript.com/forum/topic/98712-winapiex-udf/

Local $iIcon

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

GUISetState(@SW_SHOW)

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

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

    If $iControlID = -1 Then
        $iControlID = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle($iControlID))
    EndIf
    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))
    EndIf
    $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 by trancexx, on Nov 7, 2011 at 7:30:22 AM

Resolution: Rejected
Status: assignedclosed

The accent is on using UDFs.

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.