Jump to content

Search the Community

Showing results for tags 'guilistviewex.au3'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I can not understand why it does not work, Where am I wrong? #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <Array.au3> #include "GUIListViewEx.au3" #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 620, 437, 192, 124) $ListView = GUICtrlCreateListView("", 10, 64, 600, 302, -1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER)) ;_GUICtrlListView_SetExtendedListViewStyle($ListView, BitOR($LVS_AUTOARRANGE, $LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER, $LVS_EX_SUBITEMIMAGES)) GUICtrlSetFont($ListView, 12, Default, Default, "Arial") _GUICtrlListView_AddColumn($ListView, "Title", 180) _GUICtrlListView_AddColumn($ListView, "Region", 180) _GUICtrlListView_AddColumn($ListView, "Path", 180) _GUICtrlListView_AddItem($ListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($ListView, 0, "Row 1: Col 2", 1, 1) _GUICtrlListView_AddSubItem($ListView, 0, "Row 1: Col 3", 2, 2) _GUICtrlListView_AddItem($ListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($ListView, 1, "Row 2: Col 2", 1, 2) _GUICtrlListView_AddSubItem($ListView, 1, "Row 2: Col 3", 2, 2) _GUICtrlListView_AddItem($ListView, "Row 3: Col 1", 2) _GUICtrlListView_AddSubItem($ListView, 2, "Row 3: Col 2", 1, 2) _GUICtrlListView_AddSubItem($ListView, 2, "Row 3: Col 3", 2, 2) _GUIListViewEx_MsgRegister(False) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState(@SW_SHOW,$Form1) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ; ======================================================== ; This thing is responcible for click events ; ======================================================== Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iCode, $tNMHDR, $hWndListView $hWndListView = $ListView If Not IsHWnd($ListView) Then $hWndListView = GUICtrlGetHandle($ListView) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $LVN_KEYDOWN $tInfo = DllStructCreate($tagNMLVKEYDOWN, $ilParam) $iKey = DllStructGetData($tInfo, "VKey") ; Get current selection $aLastSel = StringSplit(_GUIListViewEx_GetLastSelectedItem(), "|") _ArrayDisplay($aLastSel) ;<------------ crash??? Switch $iKey Case 38 If _GUIListViewEx_GetLastSelectedItem() <> "" Then ; Move up unless at top $iCurrItem = $aLastSel[2] - 1 If $iCurrItem < 0 Then $iCurrItem = 0 EndIf _GUICtrlListView_ClickItem($hWndFrom, $iCurrItem, "top", False, 1, 2) $target = _GUICtrlListView_GetItemText($ListView, $iCurrItem, 1) Else _GUICtrlListView_ClickItem($hWndFrom, 0, "top", False, 1, 2) EndIf Case 40 If _GUIListViewEx_GetLastSelectedItem() <> "" Then ; Move down unless at bottom $iCurrItem = $aLastSel[2] + 1 If $iCurrItem >= _GUICtrlListView_GetItemCount($hWndFrom) Then $iCurrItem = _GUICtrlListView_GetItemCount($hWndFrom) - 1 EndIf _GUICtrlListView_ClickItem($hWndFrom, $iCurrItem, "down", False, 1, 2) $targetb = _GUICtrlListView_GetItemText($ListView, $iCurrItem, 1) Else _GUICtrlListView_ClickItem($hWndFrom, 0, "down", False, 1, 2) EndIf EndSwitch EndSwitch EndSwitch $iRet = _GUIListViewEx_WM_NOTIFY_Handler($hWnd, $iMsg, $iwParam, $ilParam) Return $iRet Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _GUIListViewEx_GetLastSelectedItem($iLV_Index = 0) ; Check valid index Switch $iLV_Index Case 1 To $aGLVEx_Data[0][0] ; Valid index Case Else ; Get active ListView $iLV_Index = _GUIListViewEx_GetActive() ; If no ListView active If $iLV_Index = 0 Then Return SetError(1, 0, "") EndSwitch ; Read last selected item Local $iRow = $aGLVEx_Data[$iLV_Index][20] Local $iCol = $aGLVEx_Data[$iLV_Index][21] ; Check selection has been made If $iRow = -1 Or $iCol = -1 Then Return SetError(2, 0, "") ; Return selection details Return $iLV_Index & "|" & $iRow & "|" & $iCol EndFunc ;==>_GUIListViewEx_GetLastSelectedItem
×
×
  • Create New...