#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <StructureConstants.au3>
#include <GuiListView.au3>
$GUI = GUICreate("", 332, 327)
$ListView = GUICtrlCreateListView(" ", 0, 0, 170, 326,$lvs_editlabels)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 166)
GUICtrlCreateListViewItem("2",$ListView)
GUICtrlCreateListViewItem("wWw",$ListView)
GUICtrlCreateListViewItem("Spy",$ListView)
$hLV=GUICtrlGetHandle($ListView)
$But = GUICtrlCreateButton("Выйти", 176, 0, 75, 21)
$Edit = GUICtrlCreateEdit("", 176, 32, 153, 209)
GUIRegisterMsg($wm_notify,"__NotifyListV")
$Dummy=GUICtrlCreateDummy()
Local $aHotKeys[1][2]=[["^c",$Dummy]]
GUISetAccelerators($aHotKeys,$GUI)
GUISetState(@SW_SHOW,$GUI)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Dummy
Local $GetS=_GUICtrlListView_GetSelectedIndices($hLV,True)
Local $gString
For $i=1 To $GetS[0]
$gString&=_GUICtrlListView_GetItemText($hLV,$GetS[$i])&"|"
Next;Получаем текст выделенных строк
$gString=StringTrimRight($gString,1)
ClipPut($gString)
GUICtrlSetData($Edit,"")
GUICtrlSetData($Edit,"Буфер обмена содержит:"&@CRLF&ClipGet())
ClipPut('');Опусташаем буфер
$gString=""
Case $GUI_EVENT_CLOSE,$But
Exit
EndSwitch
WEnd
Func __NotifyListV($hWnd,$Msg,$wParam,$lParam)
If $hWnd=$GUI Then
Local $tNMHDR=DllStructCreate($tagNMHDR,$lParam)
Local $hWL=HWnd(DllStructGetData($tNMHDR,"hWndFrom"))
Local $Code=DllStructGetData($tNMHDR,"Code")
If $hWL=$hLV And ($Code=$lvn_endlabeledita Or $Code=$lvn_endlabeleditw) Then
Local $tInfo=DllStructCreate($tagnmlvdispinfo,$lParam)
Local $Buffer=DllStructCreate("char Text["&DllStructGetData($tInfo,"TextMax")&"]",DllStructGetData($tInfo,"Text"))
If StringLen(DllStructGetData($Buffer,"Text")) Then
Return True ;Разрешаем редактирование и сохранение в ячейке веденный текст
EndIf
EndIf
EndIf
Return "gui_rundefmsg"
EndFunc