コントロールの背景画像を取得します。
#Include <GuiListView.au3>
_GUICtrlListView_GetBkImage($hWnd)
パラメータ
$hWnd | コントロールのハンドル |
返し値
次のフォーマットの配列を返します。
注意
なし。
関連
_GUICtrlListView_SetBkImage
例
#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
Opt('MustDeclareVars', 1)
$Debug_LV = False ; ListView関数に渡されるClassNameを調べる。動作を確認するにはTrueを設定し、他のコントロールのハンドルを使用
Example_UDF_Created()
Func Example_UDF_Created()
Local $GUI, $hImage, $aImage, $hListView
$GUI = GUICreate("(UDF Created) ListView Get Background Image", 600, 550)
;=========================================================================================================
$hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 596, 500, -1, -1, True) ; 最後のオプションでCoInitializeExを呼ぶ
;=========================================================================================================
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER))
; 画像をロード
$hImage = _GUIImageList_Create()
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFF0000, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x00FF00, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x0000FF, 16, 16))
_GUICtrlListView_SetImageList($hListView, $hImage, 1)
; 列を追加
_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)
; アイテムを追加
_GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2)
_GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1)
_GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1)
_GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2)
; グループを作成
_GUICtrlListView_EnableGroupView($hListView)
_GUICtrlListView_InsertGroup($hListView, -1, 1, "Group 1")
_GUICtrlListView_InsertGroup($hListView, -1, 2, "Group 2")
_GUICtrlListView_SetItemGroupID($hListView, 0, 1)
_GUICtrlListView_SetItemGroupID($hListView, 1, 2)
_GUICtrlListView_SetItemGroupID($hListView, 2, 2)
; 画像を取得
Local $sURL = "http://www.autoitscript.com/autoit3/files/graphics/autoit9_wall_grey_800x600.jpg"
Local $sFilePath = @ScriptDir & "\AutoIt.jpg"
InetGet($sURL, $sFilePath)
; 背景画像を設定
_GUICtrlListView_SetBkImage($hListView, $sFilePath)
$aImage = _GUICtrlListView_GetBkImage($hListView)
GUISetState()
MsgBox(4160, "Information", "Background Image: " & $aImage[1])
; ユーザーが終了するまでループ
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
;=========================================================================================================
DllCall('ole32.dll', 'long', 'CoUinitialize') ; 各CoInitializeEx呼び出し毎に呼ばなければならない
;=========================================================================================================
GUIDelete()
FileDelete($sFilePath)
EndFunc ;==>Example_UDF_Created