#include-once #include #include #include #include #include OnAutoItExitRegister("__ListViewEditInput_onExit") ; #INDEX# ======================================================================================================================= ; Title .........: ListViewEditInput ; AutoIt Version : 3.3.16.1 ; Language ......: English ; Description ...: This UDF makes it possible to edit ListviewSubitems ; Author(s) .....: Kanashius ; =============================================================================================================================== ; #VARIABLES# =================================================================================================================== Global $__ListViewEditInput_tListViewData = "PTR hGui;PTR hListView;BOOLEAN allCols;CHAR cols[100];BOOLEAN allRows;CHAR rows[100];BOOLEAN bSingleClick;CHAR changed[100];CHAR canceled[100]" Global $__ListViewEditInput_tGuiData = "PTR hGui;INT iListViewCount;INT hProc;INT hPrevProc;INT editInput;PTR editInfo" Global $__ListViewEditInput_tEditInfo = "PTR hListView;INT iIndex;INT iSubIndex" Global $__ListViewEditInput_arGuis[], $__ListViewEditInput_arListViews[] ; #CURRENT# ===================================================================================================================== ; __ListViewEditInput_ListViewAdd ; __ListViewEditInput_ListViewRemove ; __ListViewEditInput_SetEditable ; __ListViewEditInput_RegisterFunction ; __ListViewEditInput_onExit ; __ListViewEditInput_saveEdit ; __ListViewEditInput_cancelEdit ; __ListViewEditInput_editNextCell ; __ListViewEditInput_isCellEditable ; __ListViewEditInput_EditItem ; =============================================================================================================================== ; #INTERNAL_USE_ONLY# =========================================================================================================== ; __ListViewEditInput__endEdit ; __ListViewEditInput__updateNextCellIndex ; __ListViewEditInput__WinProc ; __ListViewEditInput__WM_COMMAND ; __ListViewEditInput__WM_NOTIFY ; __ListViewEditInput__WM_HOTKEY ; =============================================================================================================================== ; #FUNCTION#============================================================================== ; Name...........: __ListViewEditInput_ListViewAdd ; Description ...: Add a ListView to make it editable ; Syntax.........: __ListViewEditInput_ListViewAdd($hGui, $hListView, $sColumns=Default, $sRows=Default, $bSingleClick=False) ; Parameters ....: $hGui - Handle of the Gui, where the Listview is placed ; ...............: $hListView - CtrlID/Handle of the Listview ; ...............: $sColumns=Default - Default to Edit all Columns or ; ...............: Numbers sperated by a "," starting with 0 e.g.: 1,2,5 ; ...............: $sRows=Default - Default to Edit all Rows or ; ...............: Numbers seperated by a "," starting with 0 e.g.: 1,2,5 ; ...............: $bSingleClick=False - True if a single click should be used for editing. Uses Double click by default ; Author ........: Kanashius ; =============================================================================================================================== Func __ListViewEditInput_ListViewAdd($hGui, $hListView, $sColumns=Default, $sRows=Default, $bSingleClick=False) If Not IsHWnd($hListView) Then $hListView = GUICtrlGetHandle($hListView) If Not MapExists($__ListViewEditInput_arListViews, $hListView) Then If MapExists($__ListViewEditInput_arGuis, $hGui) Then $__ListViewEditInput_arGuis[$hGui].iListViewCount += 1 Else Local $pGuiData = DllStructCreate($__ListViewEditInput_tGuiData) $pGuiData.hGui = $hGui $pGuiData.iListViewCount = 1 $pGuiData.hProc = DllCallbackRegister('__ListViewEditInput__WinProc', 'ptr', 'hwnd;uint;wparam;lparam') $pGuiData.hPrevProc = _WinAPI_SetWindowLong($hGui, -4, DllCallbackGetPtr($pGuiData.hProc)) Local $hPrevGui = GUISwitch($hGui) $pGuiData.editInput = GUICtrlCreateInput("",10,10,10,10) GUICtrlSetState($pGuiData.editInput, $GUI_HIDE) $pGuiData.editInfo = DllStructGetPtr(DllStructCreate($__ListViewEditInput_tEditInfo)) GUISwitch($hPrevGui) _WinAPI_RegisterHotKey($hGui, BitOR(0x0100,$VK_ESCAPE), 0, $VK_ESCAPE) _WinAPI_RegisterHotKey($hGui, BitOR(0x0100,$VK_TAB), 0, $VK_TAB) _WinAPI_RegisterHotKey($hGui, BitOR(0x0100,$VK_RETURN), 0, $VK_RETURN) $__ListViewEditInput_arGuis[$hGui] = $pGuiData EndIf Local $pListViewData = DllStructCreate($__ListViewEditInput_tListViewData) $pListViewData.hGui = $hGui $pListViewData.hListView = $hListView $pListViewData.changed = "" $pListViewData.canceled = "" $__ListViewEditInput_arListViews[$hListView] = $pListViewData EndIf __ListViewEditInput_SetEditable($hListView, $sColumns, $sRows, $bSingleClick) EndFunc ; #FUNCTION#============================================================================== ; Name...........: __ListViewEditInput_ListViewRemove ; Description ...: Remove the editable ListView ; Syntax.........: __ListViewEditInput_ListViewRemove($hListView) ; Parameters ....: $hListView - Listview CtrlID/Handle ; Author ........: Kanashius ; =============================================================================================================================== Func __ListViewEditInput_ListViewRemove($hListView) If Not IsHWnd($hListView) Then $hListView = GUICtrlGetHandle($hListView) If MapExists($__ListViewEditInput_arListViews, $hListView) Then Local $hGui = $__ListViewEditInput_arListViews[$hListView].hGui MapRemove($__ListViewEditInput_arListViews, $hListView) If MapExists($__ListViewEditInput_arGuis, $hGui) Then Local $pGuiData = $__ListViewEditInput_arGuis[$hGui] $pGuiData.iListViewCount -= 1 If $pGuiData.iListViewCount = 0 Then _WinAPI_UnregisterHotKey($hGui, BitOR(0x0100,$VK_ESCAPE)) _WinAPI_UnregisterHotKey($hGui, BitOR(0x0100,$VK_TAB)) _WinAPI_UnregisterHotKey($hGui, BitOR(0x0100,$VK_RETURN)) _WinAPI_SetWindowLong($hGui, -4, $pGuiData.hPrevProc) MapRemove($__ListViewEditInput_arGuis, $hGui) EndIf EndIf EndIf EndFunc ; #FUNCTION#============================================================================== ; Name...........: __ListViewEditInput_SetEditable ; Description ...: Set the editable rows and columns and change the method to start editing ; Syntax.........: __ListViewEditInput_SetEditable($hListView, $sColumns=Default, $sRows=Default, $bSingleClick=False) ; Parameters ....: $hListView - CtrlID/Handle of the Listview ; ...............: $sColumns=Default - Default to Edit all Columns or ; ...............: Numbers sperated by a "," starting with 0 e.g.: 1,2,5 ; ...............: $sRows=Default - Default to Edit all Rows or ; ...............: Numbers seperated by a "," starting with 0 e.g.: 1,2,5 ; ...............: $bSingleClick=False - True if a single click should be used for editing. Uses Double click by default ; Author ........: Kanashius ; =============================================================================================================================== Func __ListViewEditInput_SetEditable($hListView, $sColumns=Default, $sRows=Default, $bSingleClick=False) If Not IsHWnd($hListView) Then $hListView = GUICtrlGetHandle($hListView) If MapExists($__ListViewEditInput_arListViews, $hListView) Then Local $pListViewData = $__ListViewEditInput_arListViews[$hListView] $pListViewData.allCols = Not IsString($sColumns) If IsString($sColumns) Then $pListViewData.cols = $sColumns&",x" ; add ,x because stringsplit requires at least one delimeter (x is never an index) $pListViewData.allRows = Not IsString($sRows) If IsString($sRows) Then $pListViewData.rows = $sRows&",x" ; add ,x because stringsplit requires at least one delimeter (x is never an index) $pListViewData.bSingleClick = $bSingleClick EndIf EndFunc ; #FUNCTION#============================================================================== ; Name...........: __ListViewEditInput_RegisterFunction ; Description ...: Register a function to receive events. Use an empty string "" to unregister. ; Syntax.........: __ListViewEditInput_RegisterFunction($hListView, $sFunction, $sEvent="changed") ; Parameters ....: $hListView - CtrlID/Handle of the Listview ; ...............: $sFunction=Default - The Function name to register; "" removes the call ; ...............: $sEvent="changed" - The type of event to receive; Can be either "changed" or "canceled" ; Author ........: Kanashius ; =============================================================================================================================== Func __ListViewEditInput_RegisterFunction($hListView, $sFunction, $sEvent="changed") ; Empty sFunction removes call If Not IsHWnd($hListView) Then $hListView = GUICtrlGetHandle($hListView) If MapExists($__ListViewEditInput_arListViews, $hListView) Then Switch $sEvent Case "changed" $__ListViewEditInput_arListViews[$hListView].changed = $sFunction Case "canceled" $__ListViewEditInput_arListViews[$hListView].canceled = $sFunction EndSwitch EndIf EndFunc ; #FUNCTION#============================================================================== ; Name...........: __ListViewEditInput_onExit ; Description ...: Disabled all editing on all ListViews. Called automatically on exit; ; Syntax.........: __ListViewEditInput_onExit() ; Parameters ....: $hListView - CtrlID/Handle of the Listview ; ...............: $sFunction=Default - The Function name to register; "" removes the call ; ...............: $sEvent="changed" - The type of event to receive; Can be either "changed" or "canceled" ; Author ........: Kanashius ; =============================================================================================================================== Func __ListViewEditInput_onExit() For $hListView In MapKeys($__ListViewEditInput_arListViews) __ListViewEditInput_ListViewRemove($__ListViewEditInput_arListViews[$hListView].hListView) Next EndFunc ; #FUNCTION#============================================================================== ; Name...........: __ListViewEditInput_saveLVChange ; Description ...: Saves the Changes from Input to Listview and hide the Input ; Syntax.........: __ListViewEditInput_saveLVChange($hGui) ; Parameters ....: $hGui - Handle of the Gui ; Author ........: Kanashius ; Remarks .......: For Internal Use Only ; =============================================================================================================================== Func __ListViewEditInput_saveEdit($hGui) If MapExists($__ListViewEditInput_arGuis, $hGui) Then Local $pGuiData = $__ListViewEditInput_arGuis[$hGui] Local $pEditInfo = DllStructCreate($__ListViewEditInput_tEditInfo, $pGuiData.editInfo) if BitAND(GUICtrlGetState($pGuiData.editInput), $GUI_SHOW) then Local $sData=GUICtrlRead($pGuiData.editInput) _GUICtrlListView_SetItemText($pEditInfo.hListView, $pEditInfo.iIndex, $sData, $pEditInfo.iSubIndex) if MapExists($__ListViewEditInput_arListViews, $pEditInfo.hListView) then Local $pListViewData = $__ListViewEditInput_arListViews[$pEditInfo.hListView] If $pListViewData.changed<>"" Then Call($pListViewData.changed, $pEditInfo.hListView, $pEditInfo.iIndex, $pEditInfo.iSubIndex) EndIf endif __ListViewEditInput__endEdit($hGui) endif EndIf EndFunc ; #FUNCTION#============================================================================== ; Name...........: __ListViewEditInput_cancelLVChange ; Description ...: Hides the Input ; Syntax.........: __ListViewEditInput_cancelLVChange($hGui) ; Parameters ....: $hGui - Handle of the Gui ; Author ........: Kanashius ; Remarks .......: For Internal Use Only ; =============================================================================================================================== Func __ListViewEditInput_cancelEdit($hGui) If MapExists($__ListViewEditInput_arGuis, $hGui) Then Local $pGuiData = $__ListViewEditInput_arGuis[$hGui] Local $pEditInfo = DllStructCreate($__ListViewEditInput_tEditInfo, $pGuiData.editInfo) if BitAND(GUICtrlGetState($pGuiData.editInput), $GUI_SHOW) then if MapExists($__ListViewEditInput_arListViews, $pEditInfo.hListView) then Local $pListViewData = $__ListViewEditInput_arListViews[$pEditInfo.hListView] If $pListViewData.canceled<>"" Then Call($pListViewData.canceled, $pEditInfo.hListView, $pEditInfo.iIndex, $pEditInfo.iSubIndex) EndIf endif __ListViewEditInput__endEdit($hGui) endif EndIf EndFunc ; #INTERNAL_USE_ONLY#============================================================================== ; Name...........: __ListViewEditInput__endEdit ; Description ...: Called to finish an edit ; Syntax.........: __ListViewEditInput__endEdit($hGui) ; Parameters ....: $hGui - Handle of the Gui ; Author ........: Kanashius ; Remarks .......: For Internal Use Only ; =============================================================================================================================== Func __ListViewEditInput__endEdit($hGui) If MapExists($__ListViewEditInput_arGuis, $hGui) Then Local $pGuiData = $__ListViewEditInput_arGuis[$hGui] Local $pEditInfo = DllStructCreate($__ListViewEditInput_tEditInfo, $pGuiData.editInfo) GUICtrlSetState($pGuiData.editInput, $GUI_HIDE) GUICtrlSetData($pGuiData.editInput, "") $pEditInfo.hListView = -1 $pEditInfo.iIndex = -1 $pEditInfo.iSubIndex = -1 EndIf EndFunc ; #FUNCTION#============================================================================== ; Name...........: __ListViewEditInput_editNextCell ; Description ...: Edit the next editable cell in the listview ; Syntax.........: __ListViewEditInput_editNextCell($hGui) ; Parameters ....: $hGui - Handle of the Gui ; Author ........: Kanashius ; =============================================================================================================================== Func __ListViewEditInput_editNextCell($hGui) If MapExists($__ListViewEditInput_arGuis, $hGui) Then Local $pEditInfo = DllStructCreate($__ListViewEditInput_tEditInfo, $__ListViewEditInput_arGuis[$hGui].editInfo) If $pEditInfo.hListView<>-1 Then Local $hListView = $pEditInfo.hListView Local $iColAmount = _GUICtrlListView_GetColumnCount($hListView) Local $iRowAmount = _GUICtrlListView_GetItemCount($hListView) If $iColAmount=0 Then return If $iRowAmount=0 Then return Local $arIndices = [$pEditInfo.iIndex, $pEditInfo.iSubIndex] __ListViewEditInput__updateNextCellIndex($arIndices, $iColAmount, $iRowAmount) While Not __ListViewEditInput_isCellEditable($hListview, $arIndices[0], $arIndices[1]) If $arIndices[0]=$pEditInfo.iIndex And $arIndices[1]=$pEditInfo.iSubIndex Then ExitLoop ;no other editable cell found __ListViewEditInput__updateNextCellIndex($arIndices, $iColAmount, $iRowAmount) WEnd __ListViewEditInput_EditItem($hGui, $hListview, $arIndices[0], $arIndices[1]) EndIf EndIf EndFunc ; #INTERNAL_USE_ONLY#============================================================================== ; Name...........: __ListViewEditInput__updateNextCellIndex ; Description ...: Calculate the next possible cell ; Syntax.........: __ListViewEditInput__updateNextCellIndex($arIndices, $iColAmount, $iRowAmount) ; Parameters ....: $hGui - Handle of the Gui ; Author ........: Kanashius ; Remarks .......: For Internal Use Only ; =============================================================================================================================== Func __ListViewEditInput__updateNextCellIndex(ByRef $arIndices, $iColAmount, $iRowAmount) $arIndices[1]+=1 If $arIndices[1]>=$iColAmount Then $arIndices[1]=0 $arIndices[0]+=1 EndIf If $arIndices[0]>=$iRowAmount Then $arIndices[0]=0 EndFunc ; #FUNCTION#============================================================================== ; Name...........: __ListViewEditInput_isCellEditable ; Description ...: Check if a cell is editable ; Syntax.........: __ListViewEditInput_isCellEditable($hListview, $iIndex, $iSubIndex) ; Parameters ....: $hListview - Handle of the ListView ; ...............: $iIndex - Index to check ; ...............: $iSubIndex - SubIndex to check ; Author ........: Kanashius ; =============================================================================================================================== Func __ListViewEditInput_isCellEditable($hListview, $iIndex, $iSubIndex) If Not IsHWnd($hListView) Then $hListView = GUICtrlGetHandle($hListView) If MapExists($__ListViewEditInput_arListViews, $hListview) Then Local $pListViewData = $__ListViewEditInput_arListViews[$hListview] Return ($pListViewData.allCols Or _ArraySearch(StringSplit($pListViewData.cols, ",", 1+2), $iSubIndex)>=0) And _ ($pListViewData.allRows Or _ArraySearch(StringSplit($pListViewData.rows, ",", 1+2), $iIndex)>=0) EndIf return False EndFunc ; #INTERNAL_USE_ONLY#============================================================================== ; Name...........: __ListViewEditInput__WinProc ; Description ...: Takes the Messages and give them to the WM_COMMAND, WM_NOTIFY and WM_HOTKEY function ; Syntax.........: __ListViewEditInput__WinProc($hWnd, $iMsg, $iwParam, $ilParam) ; Parameters ....: $hWnd - GuiHandle ; ...............: $iMsg - MessageCode ; ...............: $iwParam - wParam ; ...............: $ilParam - lParam ; Return values .: WindowProc ; Author ........: Kanashius ; Remarks .......: For Internal Use Only ; =============================================================================================================================== Func __ListViewEditInput__WinProc($hWnd, $iMsg, $iwParam, $ilParam) If $iMsg=$WM_NOTIFY Then __ListViewEditInput__WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) ElseIf $iMsg=$WM_COMMAND Then __ListViewEditInput__WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) ElseIf $iMsg=$WM_HOTKEY Then __ListViewEditInput__WM_HOTKEY($hWnd, $iMsg, $iwParam, $ilParam) endif If MapExists($__ListViewEditInput_arGuis, $hWnd) Then Return _WinAPI_CallWindowProc($__ListViewEditInput_arGuis[$hWnd].hPrevProc, $hWnd, $iMsg, $iwParam, $ilParam) EndIf EndFunc ; #INTERNAL_USE_ONLY#============================================================================== ; Name...........: __ListViewEditInput__WM_COMMAND ; Description ...: Find out when the Input should be hidden (with or without saves) ; Syntax.........: __ListViewEditInput__WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) ; Parameters ....: $hWnd - GuiHandle ; ...............: $iMsg - MessageCode ; ...............: $iwParam - wParam ; ...............: $ilParam - lParam ; Return values .: $GUI_RUNDEFMSG ; Author ........: Kanashius ; Remarks .......: For Internal Use Only ; =============================================================================================================================== Func __ListViewEditInput__WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word $iCode = BitShift($iwParam, 16) ; Hi Word If MapExists($__ListViewEditInput_arGuis, $hWnd) Then Switch $hWndFrom Case GUICtrlGetHandle($__ListViewEditInput_arGuis[$hWnd].editInput) Switch $iCode Case 512 __ListViewEditInput_saveEdit($hWnd) EndSwitch EndSwitch EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND ; #INTERNAL_USE_ONLY#============================================================================== ; Name...........: __ListViewEditInput__WM_NOTIFY ; Description ...: Detect the click at a subitem to show the edit ; Syntax.........: __ListViewEditInput__WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) ; Parameters ....: $hWnd - GuiHandle ; ...............: $iMsg - MessageCode ; ...............: $iwParam - wParam ; ...............: $ilParam - lParam ; Return values .: $GUI_RUNDEFMSG ; Author ........: Kanashius ; Remarks .......: For Internal Use Only ; =============================================================================================================================== Func __ListViewEditInput__WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $tInfo $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") If MapExists($__ListViewEditInput_arListViews, $hWndFrom) Then Local $pListViewData = $__ListViewEditInput_arListViews[$hWndFrom] If (Not $pListViewData.bSingleClick And $iCode=$NM_DBLCLK) Or ($pListViewData.bSingleClick And $iCode=$NM_CLICK) Then Local $tmp = AutoItSetOption("MouseCoordMode", 2) Local $arPos = MouseGetPos() Local $arCtrlPos = ControlGetPos($pListViewData.hGui, "", $pListViewData.hListView) $arItem = _GUICtrlListView_SubItemHitTest($pListViewData.hListView, $arPos[0]-$arCtrlPos[0], $arPos[1]-$arCtrlPos[1]) __ListViewEditInput_EditItem($hWnd, $hWndFrom, $arItem[0], $arItem[1]) AutoItSetOption("MouseCoordMode", $tmp) EndIf EndIf Return $GUI_RUNDEFMSG EndFunc ; #INTERNAL_USE_ONLY#============================================================================== ; Name...........: __ListViewEditInput__WM_HOTKEY ; Description ...: Detect the press of a registered key ; Syntax.........: __ListViewEditInput__WM_HOTKEY($hWnd, $iMsg, $iwParam, $ilParam) ; Parameters ....: $hWnd - GuiHandle ; ...............: $iMsg - MessageCode ; ...............: $iwParam - wParam ; ...............: $ilParam - lParam ; Return values .: $GUI_RUNDEFMSG ; Author ........: Kanashius ; Remarks .......: For Internal Use Only ; =============================================================================================================================== Func __ListViewEditInput__WM_HOTKEY($hWnd, $iMsg, $iwParam, $ilParam) Switch _WinAPI_HiWord($ilParam) Case $VK_ESCAPE __ListViewEditInput_cancelEdit($hWnd) Case $VK_TAB __ListViewEditInput_editNextCell($hWnd) Case $VK_RETURN __ListViewEditInput_saveEdit($hWnd) EndSwitch EndFunc ; #FUNCTION#============================================================================== ; Name...........: __ListViewEditInput_EditItem ; Description ...: Detect the click at a subitem to show the edit ; Syntax.........: __ListViewEditInput_EditItem($hGui, $listview,$index,$subindex,$isIndex) ; Parameters ....: $hGui - Handle of the Gui ; ...............: $listview - Listview Ctrl or Index of Control ; ...............: $index - Index to edit ; ...............: $subindex - Subindex to edit ; Author ........: Kanashius ; =============================================================================================================================== Func __ListViewEditInput_EditItem($hGui, $hListview, $iIndex, $iSubIndex) If Not IsHWnd($hListView) Then $hListView = GUICtrlGetHandle($hListView) If MapExists($__ListViewEditInput_arGuis, $hGui) Then Local $pGuiData = $__ListViewEditInput_arGuis[$hGui] If MapExists($__ListViewEditInput_arListViews, $hListview) Then Local $pListViewData = $__ListViewEditInput_arListViews[$hListview] If $iIndex<>-1 And $iSubIndex<>-1 And __ListViewEditInput_isCellEditable($hListview, $iIndex, $iSubIndex) Then __ListViewEditInput_saveEdit($hGui) Local $pEditInfo = DllStructCreate($__ListViewEditInput_tEditInfo, $pGuiData.editInfo) $pEditInfo.hListView = $hListView $pEditInfo.iIndex = $iIndex $pEditInfo.iSubIndex = $iSubIndex Local $arItemRect = _GUICtrlListView_GetSubItemRect($hListview, $iIndex, $iSubIndex) if $iSubIndex=0 Then ; because with subitem 0 the complete row is used for the rectangle :/ local $arNextSubItem=_GUICtrlListView_GetSubItemRect($hListview, $iIndex, $iSubIndex+1) $arItemRect[2]=$arNextSubItem[0]-$arItemRect[0] endif Local $arPosListView = ControlGetPos($pListViewData.hGui, "", $hListView) GUICtrlSetPos($pGuiData.editInput, $arPosListView[0]+$arItemRect[0]+2, $arPosListView[1]+$arItemRect[1]+2, _ $arItemRect[2]-$arItemRect[0], $arItemRect[3]-$arItemRect[1]) GUICtrlSetData($pGuiData.editInput, _GUICtrlListView_GetItemText($hListview, $iIndex, $iSubIndex)) GUICtrlSetState($pGuiData.editInput, $GUI_SHOW) GUICtrlSetState($pGuiData.editInput, $GUI_ONTOP) GUICtrlSetState($pGuiData.editInput, $GUI_FOCUS) Local $rect = DllStructCreate($tagRECT) $rect.Left = $arPosListView[0]+$arItemRect[0]-10 $rect.Top = $arPosListView[1]+$arItemRect[1]-10 $rect.Right = $arItemRect[2]+10 $rect.Bottom = $arItemRect[3]+10 _WinAPI_RedrawWindow($pListViewData.hGui, $rect, 0, BitOR($RDW_ERASE, $RDW_FRAME, $RDW_INVALIDATE, $RDW_ALLCHILDREN, $RDW_ERASENOW, $RDW_UPDATENOW)) GUICtrlSetState($pGuiData.editInput, $GUI_FOCUS) Return True EndIf EndIf __ListViewEditInput__endEdit($hGui) EndIf Return False EndFunc