#include <WinAPIRes.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
$hInst = _WinAPI_LoadLibrary("Drives.dll")
$aData = _WinAPI_EnumResourceNames($hInst, $RT_BITMAP)
If @error Then Exit MsgBox(0, "Error", "Bitmap-ресурсы не найдены")
GUICreate("BmpResView", 210, 310)
$hLV = GUICtrlGetHandle(GUICtrlCreateListView("", 5, 5, 200, 300))
GUISetState(@SW_SHOW)
$hImage = _GUIImageList_Create(32, 32)
For $i = 1 To $aData[0]
$hBitmap = _WinAPI_LoadBitmap($hInst, $aData[$i])
$hZoomBmp = ZoomBmp($hBitmap)
_GUIImageList_Add($hImage, $hZoomBmp)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteObject($hZoomBmp)
Next
_GUICtrlListView_SetImageList($hLV, $hImage, 1)
_GUICtrlListView_AddColumn($hLV, "Bitmaps", 150)
For $i = 1 To $aData[0]
_GUICtrlListView_AddItem($hLV, $aData[$i], $i - 1)
Next
Do
Until GUIGetMsg() = -3
Func ZoomBmp($hBmp)
$hDC = _WinAPI_GetDC(0)
$dDC = _WinAPI_CreateCompatibleDC($hDC)
$zBmp = _WinAPI_CreateCompatibleBitmap($hDC, 32, 32)
_WinAPI_SelectObject($dDC, $zBmp)
$sDC = _WinAPI_CreateCompatibleDC($hDC)
_WinAPI_SelectObject($sDC, $hBmp)
_WinAPI_StretchBlt($dDC, 0, 0, 32, 32, $sDC, 0, 0, 16, 16, 0x00CC0020) ; $SRCCOPY
_WinAPI_DeleteDC($dDC)
_WinAPI_DeleteDC($sDC)
_WinAPI_ReleaseDC(0, $hDC)
Return $zBmp
EndFunc