Moderators Melba23 Posted December 9, 2024 Author Moderators Posted December 9, 2024 ValentinM, Spendid news! I will release a new version soon. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Moderators Melba23 Posted December 9, 2024 Author Moderators Posted December 9, 2024 ValentinM, Spendid news! I will release a new version soon. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Moderators Melba23 Posted December 11, 2024 Author Moderators Posted December 11, 2024 [New VERSION] - 11 Dec 24 Added: New function _GUIListViewEx_EditProcessActive which returns the handle of the ListView concerned if an element is being edited. Usage scenario: prevent HotKeys from working when editing is underway. Fixed: A couple of bugs with columns: added columns were automatically sortable; dragging columns meant editing pop-up could appear in wrong place. Thanks to ValentinM for the reports. New UDF in the first post. M23 ioa747, robertocm and ValentinM 2 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
ValentinM Posted December 24, 2024 Posted December 24, 2024 (edited) Hello Melba, Today I was doing the final tests of my application, and I encountered a case I did not expect to fail. I have a function that deletes columns, using your _GUIListViewEx_DeleteColSpec() function. Unfortunately, when I try to delete the last column of the Listview, I get this error : Spoiler I've been able to fix this on my side, just by doing "if columns count is = 1 then abort", and it is not currently a problem in my app. Anyway, I think it deserves a fix in the future version. Are you able to reproduce the issue ? I wish you a Merry Christmas, take care ! Edited December 30, 2024 by ValentinM May the force be with you. Open AutoIt Documentation within VS Code
ermar Posted August 29, 2025 Posted August 29, 2025 Hi everyone, Thanks to Melba for this really powerful UDF. Do you have a simple example of a listview using this UDF with 3 columns that can be modified on column 2 and 3 only and in Event mode (Opt("GUIOnEventMode", 1)) with a WM_Notify event handling at the same time ? I'm tearing my hair out trying to integrate an example into my main script where several listviews coexist in several tabs. I'd like to start on a good basis. There are subtleties that must escape me, my English is not very good. Thank you for your help.
Moderators Melba23 Posted August 29, 2025 Author Moderators Posted August 29, 2025 ermar, Certainly - how about this: expandcollapse popup#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx.au3" Opt("GUIOnEventMode", 1) ; Create GUI $hGUI = GUICreate("LVEx Example", 320, 320) ; Create ListView $cListView = GUICtrlCreateListView("Tom|Dick|Harry", 10, 10, 300, 300, $LVS_SHOWSELALWAYS) _GUICtrlListView_SetExtendedListViewStyle($cListView, $LVS_EX_FULLROWSELECT) _GUICtrlListView_SetColumnWidth($cListView, 0, 93) _GUICtrlListView_SetColumnWidth($cListView, 1, 93) _GUICtrlListView_SetColumnWidth($cListView, 2, 93) ; Set font GUICtrlSetFont($cListView, 12, Default, Default, "Courier New") ; Note edit control will use same font ; Create array and fill listview Global $aLV_List[20] For $i = 0 To UBound($aLV_List) - 1 If Mod($i, 5) Then $aLV_List[$i] = "Tom " & $i & "|Dick " & $i & "|Harry " & $i Else $aLV_List[$i] = "Tom " & $i & "||Harry " & $i EndIf GUICtrlCreateListViewItem($aLV_List[$i], $cListView) Next ; Initiate LVEx $iLV_Left_Index = _GUIListViewEx_Init($cListView, $aLV_List) ; Column 1 & 2 editable - simple text _GUIListViewEx_SetEditStatus($iLV_Left_Index, "1;2") ; Register for sorting, dragging and editing - but do NOT register WM_Notify _GUIListViewEx_MsgRegister(Default) ; Now register the user WM_NOTIFY handler GUIRegisterMsg(0x004E, "_User_WM_NOTIFY_Handler") GUISetState() GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_Ex") While 1 Sleep(10) $vRet = _GUIListViewEx_EventMonitor(0) If @error Then MsgBox($MB_SYSTEMMODAL, "Error", "Event error: " & @error) EndIf Switch @extended Case 1 If $vRet = "" Then MsgBox($MB_SYSTEMMODAL, "Edit", "Edit aborted" & @CRLF) Else _ArrayDisplay($vRet, "ListView " & _GUIListViewEx_GetActive() & " content edited", Default, 8) EndIf EndSwitch WEnd Func _Exit_Ex() Exit EndFunc Func _User_WM_NOTIFY_Handler($hWnd, $iMsg, $wParam, $lParam) ; Do whatever the user handler is supposed to do here ; Must be LAST line of the handler Return(_GUIListViewEx_WM_NOTIFY_Handler($hWnd, $iMsg, $wParam, $lParam)) EndFunc Please ask if you have any questions. M23 robertocm and pixelsearch 2 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
ermar Posted August 30, 2025 Posted August 30, 2025 Hello Melba, thank you very much for this example. It helps me move forward with correcting my script and understanding the methodology. I will probably have more questions. I am progressing slowly but surely :-). Thank you again. Ermar
Moderators Melba23 Posted September 7, 2025 Author Moderators Posted September 7, 2025 [New VERSION] - 07/09/25 With release of AutoIt v3.3.18.0 an internal reorganisation of the standard includes requires and additional #include line to the UDF - new version in the zip in the first post. M23 argumentum 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Resiak1811 Posted September 30, 2025 Posted September 30, 2025 (edited) Hi Melba, i think you forgot to include : #include <WinAPISysWin.au3> in the new version of GUIListViewEx.au3 (otherwise we get an error when running the ex.1) and thank you for the new version by the way :) Edited September 30, 2025 by Resiak1811
Moderators Melba23 Posted September 30, 2025 Author Moderators Posted September 30, 2025 Resiak1811, That line is most certainly in the latest release in the first post of this thread - which is why I released a new version! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Resiak1811 Posted January 21 Posted January 21 (edited) Hello Melba, It's me again! Do you have a list of event errors? in my program, I'm getting an event error 3 from one of my ListViews… and an error 2 from another ListView (the two ListViews are in different child windows). for now, to avoid these errors, i have to do : If Not @error Then ... under the $vRet = _GUIListViewEx_EventMonitor($iEditMode) ... I tried your example five messages above: expandcollapse popup#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPISysWin.au3> #include "GUIListViewEx.au3" Opt("GUIOnEventMode", 1) ; Create GUI $hGUI = GUICreate("LVEx Example", 320, 320) ; Create ListView $cListView = GUICtrlCreateListView("Tom|Dick|Harry", 10, 10, 300, 300, $LVS_SHOWSELALWAYS) _GUICtrlListView_SetExtendedListViewStyle($cListView, $LVS_EX_FULLROWSELECT) _GUICtrlListView_SetColumnWidth($cListView, 0, 93) _GUICtrlListView_SetColumnWidth($cListView, 1, 93) _GUICtrlListView_SetColumnWidth($cListView, 2, 93) ; Set font GUICtrlSetFont($cListView, 12, Default, Default, "Courier New") ; Note edit control will use same font ; Create array and fill listview Global $aLV_List[20] For $i = 0 To UBound($aLV_List) - 1 If Mod($i, 5) Then $aLV_List[$i] = "Tom " & $i & "|Dick " & $i & "|Harry " & $i Else $aLV_List[$i] = "Tom " & $i & "||Harry " & $i EndIf GUICtrlCreateListViewItem($aLV_List[$i], $cListView) Next ; Initiate LVEx $iLV_Left_Index = _GUIListViewEx_Init($cListView, $aLV_List) ; Column 1 & 2 editable - simple text _GUIListViewEx_SetEditStatus($iLV_Left_Index, "1;2") ; Register for sorting, dragging and editing - but do NOT register WM_Notify _GUIListViewEx_MsgRegister(Default) ; Now register the user WM_NOTIFY handler GUIRegisterMsg(0x004E, "_User_WM_NOTIFY_Handler") GUISetState() GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_Ex") While 1 Sleep(10) $vRet = _GUIListViewEx_EventMonitor(0) If @error Then MsgBox($MB_SYSTEMMODAL, "Error", "Event error: " & @error) EndIf Switch @extended Case 1 If $vRet = "" Then MsgBox($MB_SYSTEMMODAL, "Edit", "Edit aborted" & @CRLF) Else _ArrayDisplay($vRet, "ListView " & _GUIListViewEx_GetActive() & " content edited", Default, 8) EndIf EndSwitch WEnd Func _Exit_Ex() Exit EndFunc Func _User_WM_NOTIFY_Handler($hWnd, $iMsg, $wParam, $lParam) ; Do whatever the user handler is supposed to do here ; Must be LAST line of the handler Return(_GUIListViewEx_WM_NOTIFY_Handler($hWnd, $iMsg, $wParam, $lParam)) EndFunc Columns 2 and 3 are editable (as expected), but when I double-click on column 1, I also get an event error 3. 😕 thank you for your patience ! Edited January 21 by Resiak1811
Moderators Melba23 Posted January 21 Author Moderators Posted January 21 Resiak1811, Quote Do you have a list of event errors? If you look at the function headers inside the GUIListViewEx.au3 file you will see that each and every function has an exhaustive list of return values for success and failure cases. Quote Columns 2 and 3 are editable (as expected), but when I double-click on column 1, I also get an event error 3 And from the returns listed in the header for the EventMonitor function: ; Failure: Sets @error as follows when editing: ; 1 - Invalid EditMode parameter ; 2 - Empty ListView ; 3 - Column not editable So such an error is exactly what I would expect to see. Please post again if anything is not clear. M23 Resiak1811 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Resiak1811 Posted January 31 Posted January 31 Hi Melba, For the past two days (without crashing), I think I've found my stability problem (Yay!) P.S.: My stability problem has nothing to do with my next question. I'll copy a part of my script so you will understand my question: expandcollapse popupLocal $vRet = _GUIListViewEx_EventMonitor($iEditMode) If Not @error Then Switch @extended Case 0 ; No event detected Case 1 If $vRet <> "" Then Local $line, _ $row = $vRet[1][0], _ $column = $vRet[1][1], _ $before = $vRet[1][2], _ $after = $vRet[1][3], _ $iLV_Index = _GUIListViewEx_GetActive() If StringRegExp($after, "^ *| *$") Then $after = StringStripWS($after, $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES) Switch $column Case 0 ; "Item" $line = "UPDATE `table` SET `item` = '" & FastEsc($after) & "' WHERE `item` = '" & $before & "';" $line &= ... and more (..erase to avoid long post) If Not _EzMySql_Exec("START TRANSACTION; " & $line & " COMMIT;") Then MsgBox(48, "SQL Error", _EzMySql_ErrMsg(), 0, $LogChild) Else ; _GUIListViewEx_ChangeItem($iLV_Index, $row, $column, $after) ; <------ Do I really need that line ?? _GUICtrlListView_SetItemSelected($LogList, $row, True) _GUICtrlListView_EnsureVisible($LogList, $row, True) EndIf Case 4 ; Comment Local $fItemArray = _GUICtrlListView_GetItemTextArray($LogList, $row) $line = "UPDATE `table` SET `tablecomment` = '" & FastEsc($after) & "' WHERE `tableitem` = '" & $fItemArray[1] & "';" $line &= "UPDATE `tablelist` SET `tablepart` = '" & FastEsc($after) & "' WHERE `tablenumber` = '" & $fItemArray[1] & "';" If Not _EzMySql_Exec("START TRANSACTION; " & $line & " COMMIT;") Then MsgBox(48, "SQL Error", _EzMySql_ErrMsg(), 0, $LogChild) Else ; _GUIListViewEx_ChangeItem($iLV_Index, $row, $column, $after) ; <------ Do I really need that line ?? _GUICtrlListView_SetItemSelected($LogList, $row, True) _GUICtrlListView_EnsureVisible($LogList, $row, True) EndIf EndSwitch EndIf EndSwitch EndIf If the line is not present, it works... I can edit the field, write some text, press enter and the "new" text is there and if the line is present, it also works? I can edit the field, write some text, press enter and the "new" text is there (same result) The only time I seem to really need the line is when I modify the $after, for example: If $after = "d" Then $after = "DbXb" If $after = "c" Then $after = "CbXb" $iLV_Index = _GUIListViewEx_GetActive() _GUIListViewEx_ChangeItem($iLV_Index, $row, $column, $after) I'm a little confused. Probably (and I'm pretty sure) I'm doing something "wrong" with the : _GUIListViewEx_Init / _GUIListViewEx_SetEditStatus and the _GUIListViewEx_Close.. but it work so maybe that's why I don't really "need" that line.. Your script is so powerful that I'm having trouble integrating it properly into my program. ( I'm about to ($)hire($) you to debug my program lol ) thank you again for your patience !
Moderators Melba23 Posted Saturday at 01:57 PM Author Moderators Posted Saturday at 01:57 PM Resiak1811, Sorry for the delay in replying - I am having to deal with some serious medical issues at the moment and AutoIt is coming a very poor second to my family when I get any free time. In answer to your query: You do NOT need that line to change the cell contents - the edit takes place within the UDF and the array you access via the _EventMonitor function shows both the original and new contents of the edited cell ($before and $after in your code). However, if you subsequently change the "new" value then you definitely WILL need to use the _ChangeItem function to tell the UDF that the value has changed or it will all end in tears very quickly. Does that answer your question? M23 Resiak1811 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
WildByDesign Posted Saturday at 02:17 PM Posted Saturday at 02:17 PM 17 minutes ago, Melba23 said: I am having to deal with some serious medical issues at the moment and AutoIt is coming a very poor second to my family We will all keep you in our thoughts and wishing the best outcome for your health. Family and health comes first. Melba23 and SOLVE-SMART 2
Resiak1811 Posted Saturday at 08:30 PM Posted Saturday at 08:30 PM Thank you Melba, and most importantly, take care of yourself. Melba23 1
Resiak1811 Posted 20 hours ago Posted 20 hours ago When you come back and feel better, here are 2 quick questions : 1) if the listview is currently _GUIListViewEx_Close(), should I use _GUIListViewEx_Delete() to remove 1 item from the listview or I can use the normal _GUICtrlListView_DeleteItemsSelected($list) ? 2) do you think you can make the UDF case-sensitive ? E.g.: "comMent" can't be rename to "comment".. for now if I mistype, I have to put a dot like this: "comm.ent" and then rename again to "comment". thank you again your help is really appreciated!
Moderators Melba23 Posted 1 hour ago Author Moderators Posted 1 hour ago Resiak1811, It will take a while before my treatment is over, but I am not permanently incommunicado. 1) If you have used GLVEx_Close then the UDF no longer recognises the ListView and further GVLEx_ functions will not work. So you need to use the "classic" UDF to action it. 2) Try the following small change in the GLVEx_EditProcess function: ; Line 5202 reads: If $sItemNewText <> $sItemOrgText Then ; Change it to read: If Not($sItemNewText == $sItemOrgText) That should force a case-sensitive comparison. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now