Modify ↓
Opened on Jun 17, 2010 at 12:59:33 PM
Closed on Nov 7, 2011 at 7:30:22 AM
#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:2 by , on Jun 18, 2010 at 8:30:59 AM
GUICtrlCreateIcon works fine for icons but not for thumbnails.
comment:4 by , 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.
comment:5 by , on Jun 28, 2010 at 6:09:43 AM
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:6 by , 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 , on Nov 7, 2011 at 7:30:22 AM
| Resolution: | → Rejected |
|---|---|
| Status: | assigned → closed |
The accent is on using UDFs.
Note:
See TracTickets
for help on using tickets.

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