#include <GuiListView.au3>
Global const $nm_dblclk = -3
Global const $wm_Notify = 0x4e
$hGui = GuiCreate('ListView Test', 400, 600)
Local $lvsExStyle = BitOr($lvs_ex_fullrowselect, _
$lvs_ex_gridlines, _
$lvs_ex_doublebuffer)
Local $lvs1 = GuiCtrlCreateListView("List1|View|Test", 5, 5, 390, 260, $lvs_report, $lvsExStyle+0x200)
Local $lvs2 = GuiCtrlCreateListView("List2|View|Test", 5, 270, 390, 260, $lvs_report, $lvsExStyle+0x200)
For $d = 1 to 10
$var = "lvs item " & $d
$var &= "|" & $var & " - 1|" & $var & " - 2"
GuiCtrlCreateListViewItem($var, $lvs1)
Next
For $d = 0 to 2
_GuiCtrlListView_SetColumnWidth($lvs2, $d, 100)
Next
GuiRegisterMsg($wm_Notify, "_wmNotify")
GuiSetState()
Do
$msg = GuiGetMsg()
Until $msg = -3
Func _wmNotify($hWnd, $message, $wParam, $sParam)
Local $tNmhdr, $hWndFrom, $code
$tNmhdr = DLLStructCreate($tagNmhdr, $sParam)
$hWndFrom = DLLStructGetData($tNmhdr, "hWndFrom")
$code = DLLStructGetData($tNmhdr, "code")
If $code = $nm_dblclk then
If $hWndFrom = GuiCtrlGetHandle($lvs1) then
_GuiCtrlListView_CopyItems($lvs1, $lvs2, False)
ElseIf $hWndFrom = GuiCtrlGetHandle($lvs2) then
_GuiCtrlListView_DeleteItemsSelected($hWndFrom)
EndIf
EndIf
$tNmhdr = 0
EndFunc ;==>_wmNotify()
|