Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/16/2022 in all areas

  1. I had a code which needed a doubleclick on the LW to work. Here is a modified code to use the single click: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> Local $test[5][2] = [['.au3', 'AutoIt'], ['.ahk', 'Auto Hotkey'], ['.txt', 'text'],['.sdlbas', 'Sdl Basic'], ['.html', 'Webpage']] $Form1 = GUICreate("Create New File", 210, 307, -1,-1, $WS_CAPTION , $WS_EX_TOOLWINDOW) $List = GUICtrlCreateListView("", 5,5, 200, 200) _GUICtrlListView_InsertColumn($List, 0, "Extension", 80) _GUICtrlListView_InsertColumn($List, 1, "Name", 130) _GUICtrlListView_AddArray($List, $test) $Button1 = GUICtrlCreateButton("Ok", 16, 214, 45, 26) $Button2 = GUICtrlCreateButton("Cancel", 140, 214, 45, 26) $cDummy = GUICtrlCreateDummy() GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button2 Exit Case $Button1, $cDummy local $tmptxt=StringSplit(_GUICtrlListView_GetItemTextString($List), "|")[1] if StringLen($tmptxt)>0 then MsgBox(0, "test", $tmptxt) EndIf EndSwitch WEnd ;================================================================================ Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView $hWndListView = $List If Not IsHWnd($List) Then $hWndListView = GUICtrlGetHandle($List) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_CLICK GUICtrlSendToDummy($cDummy) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc
    2 points
  2. If you read carefully help file, you should understand that the LV ID is not the same as the AutoIt GUI ID. The listview ID is an internal ID to track uniqueness of an item (changes can happened after deletion/creation). But you can get the actual AutoIt GUI ID, with _GUICtrlListView_GetItemParam when you create your LV items with GUICtrlCreateListViewItem (as AutoIt assigns its own ID to the data param of the listview)
    1 point
  3. That is called in SciTE: Calltip. Calltip uses the au3.api file that comes with the AutoIt3 Installer and has these possible options for ControlListView(): ControlListView ( "title", "text", "classnameNN", "DeSelect", From [, To] ) Deselects one or more items. ControlListView ( "title", "text", "classnameNN", "FindItem", "string to find" [, SubItem] ) Returns the item index of the string. Returns -1 if the string is not found. ControlListView ( "title", "text", "classnameNN", "GetItemCount" ) Returns the number of list items. ControlListView ( "title", "text", "classnameNN", "GetSelected" [, option] ) Returns a string containing the item index of selected items. If option=0 (default) only the first selected item is returned. If option=1 then all the selected items are returned delimited by |, e.g: &quot;0|3|4|10&quot;. If no items are selected a blank "" string is returned. ControlListView ( "title", "text", "classnameNN", "GetSelectedCount" ) Returns the number of items that are selected. ControlListView ( "title", "text", "classnameNN", "GetSubItemCount" ) Returns the number of subitems. ControlListView ( "title", "text", "classnameNN", "GetText", Item, SubItem ) Returns the text of a given item/subitem. ControlListView ( "title", "text", "classnameNN", "IsSelected", Item ) Returns 1 if the item is selected, otherwise returns 0. ControlListView ( "title", "text", "classnameNN", "Select", From [, To] ) Selects one or more items. ControlListView ( "title", "text", "classnameNN", "SelectAll" ) Selects all items. ControlListView ( "title", "text", "classnameNN", "SelectClear" ) Clears the selection of all items. ControlListView ( "title", "text", "classnameNN", "SelectInvert" ) Inverts the current selection. ControlListView ( "title", "text", "classnameNN", "ViewChange", "view" ) Changes the current view. Valid views are "list", "details", "smallicons", "largeicons". ...so somewhere in the generation of the au3.api file the 3rd parameter for this function, and ControlCommand as well, is change. It isn't wrong but don't know why that is happening. These functions have multiple options defined by "@@ControlCommandTable@@" in the helpfile generation txt file, so this needs to be checked.
    1 point
×
×
  • Create New...