Sign in to follow this  
Followers 0
nikink

listview x3 in same gui with onclick action

5 posts in this topic

#1 ·  Posted (edited)

Ok, I'm not with my buggy script at the moment, so I don't have code to post sorry!

But I have a gui with two listviews at the moment ( ultimately I think I need 3), and I've utilised the helpfile and taken some suggestions from Rasim to come up with something along these lines:

makeGui
makeLvw1
setLvw1Data
makelvw2
setLvw2Data

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView
    $hListView1 = guictrlGetHandle(Lvw1)
    $hWndListView1 = $hListView1
    If Not IsHWnd($hListView1) Then $hWndListView1 = GUICtrlGetHandle($hListView1)

    $hListView2 = guictrlGetHandle(Lvw2)
    $hWndListView2 = $hListView2
    If Not IsHWnd($hListView2) Then $hWndListView2 = GUICtrlGetHandle($hListView2)

    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hWndListView1
            Switch $iCode
                Case $NM_CLICK; Sent by a list-view control when the user clicks an item with the left mouse button
                    Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
                    CallFunc1(); to Update Lvw2
                   ; No return value
            EndSwitch
        Case $hWndListView2
            Switch $iCode
                Case $NM_CLICK; Sent by a list-view control when the user clicks an item with the left mouse button
                    Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
                    CallFunc2(); to update lvw3 eventually, for now, outputs to console ala the helpfile's _Debug()
                   ; No return value
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc

Now, my question is, *should* that work? Or have I done something silly and blindingly obvious to people in the know? Currently that code causes my script to work ok a couple of times when clicking on items in Lvw1 and then freeze up, or activate totally unrelated controls when I click on the first few items in Lvw2 before freezing up.

If this part looks like it *should* be fine, then the problem must be with how I've created the entire gui overall I suppose. (As I'm a gui noob, this would not surprise me at all!)

Please help / advise as much as you can! All is welcome, I'm trying to learn! :)

Edited by nikink

Share this post


Link to post
Share on other sites



Actually, scratch that, the helpfile code freezies on me even when there's only one listview! Takes a while, upto thirty mouse clicks, but sometimes around 10. Is this a flaw in the help file example, or in my code? If you think it's my code, any idea what may be causing the problem? I don't see how any of my code could be the issue - but if I *could* see such a thing, I wouldn't need to ask here I suppose! :)

Share this post


Link to post
Share on other sites

Ok, I have got my code trimmed downto replicate this freezing issue:

#include <Array.au3>
#include <Array2D.au3>
#include <GUIConstants.au3>
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#region - GUI Alter Skills
$btnhgt = 25
Global $Styles = BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS)
Global $guiAlterSkills = GUICreate("Alter Skills")
Global $Styles_lvwKWords = BitOr($LVS_REPORT, $LVS_SHOWSELALWAYS, $LVS_SORTASCENDING)

;~ $hTreeView = _GUICtrlTreeView_Create ($guiAlterSkills, 10, 10, 150, 300, $iStyle, $WS_EX_CLIENTEDGE)
Global $lvwKWords = _GUICtrlListView_Create($guiAlterSkills, "All Keywords ", 10, 10, 150, 300, $Styles)
_GUICtrlListView_SetExtendedListViewStyle($lvwKWords, $LVS_EX_ONECLICKACTIVATE)
_GUICtrlListView_SetColumnWidth($lvwKWords, 0, 125)

For $ii = 1 To 10
    _GUICtrlListView_AddItem($lvwKWords, $ii)
Next

Global $lvwAllSkills = _GUICtrlListView_Create($guiAlterSkills, "All Skills of Specific Keyword     ", 170, 10, 200, 300, $Styles)
For $i = 1 To 20
;$sTemp &= $aSkills[$i][0] & @CRLF
    _GUICtrlListView_AddItem($lvwAllSkills, $i)
Next
_GUICtrlListView_SetColumnWidth($lvwAllSkills, 0, 175)
Global $hlvwAllSkills = GUICtrlGetHandle($lvwAllSkills)
Global $btnClose_guiAlterSkills = GUICtrlCreateButton("Go Back", 10, 13*$btnhgt, 50, 50, $BS_MULTILINE)

#endregion
GUISetState(@SW_SHOW, $guiAlterSkills)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
While 1
    $msg = GUIGetMsg(1)
    Select
        Case $msg[1] = $guiAlterSkills
            Select
                Case $msg[0] = $GUI_EVENT_CLOSE Or $msg[0] = $btnClose_guiAlterSkills
;~                  _ShowWindow(8)
                    Exit
            EndSelect
            
    EndSelect
WEnd
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView
    $hListView1 = $lvwKWords
    $hWndListView1 = $hListView1
    If Not IsHWnd($hListView1) Then $hWndListView1 = GUICtrlGetHandle($hListView1)

    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hWndListView1
            Switch $iCode
;~            Case $LVN_BEGINDRAG; A drag-and-drop operation involving the left mouse button is being initiated
;~                Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~                _DebugPrint("$LVN_BEGINDRAG" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                        "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                        "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                        "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                        "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                        "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~               ; No return value
;~            Case $LVN_BEGINLABELEDIT; Start of label editing for an item
;~                Local $tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
;~                _DebugPrint("$LVN_BEGINLABELEDIT" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
;~                        "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
;~                        "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
;~                        "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
;~                        "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
;~                        "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
;~                        "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
;~                        "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
;~                Return False; Allow the user to edit the label
;~               ;Return True ; Prevent the user from editing the label
;~            Case $LVN_BEGINRDRAG; A drag-and-drop operation involving the right mouse button is being initiated
;~                Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~                _DebugPrint("$LVN_BEGINRDRAG" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                        "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                        "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                        "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                        "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                        "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~               ; No return value
;~            Case $LVN_BEGINSCROLL; A scrolling operation starts, Minium OS WinXP
;~                Local $tInfo = DllStructCreate($tagNMLVSCROLL, $ilParam)
;~                _DebugPrint("$LVN_BEGINSCROLL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->DX:" & @TAB & DllStructGetData($tInfo, "DX") & @LF & _
;~                        "-->DY:" & @TAB & DllStructGetData($tInfo, "DY"))
;~               ; No return value
;~               Case $LVN_COLUMNCLICK; A column was clicked
;~                   Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~                   _DebugPrint("$LVN_COLUMNCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                           "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                           "-->Code:" & @TAB & $iCode & @LF & _
;~                           "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                           "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                           "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                           "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                           "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                           "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                           "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                           "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~                  ; No return value
;~            Case $LVN_DELETEALLITEMS; All items in the control are about to be deleted
;~                Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~                _DebugPrint("$LVN_DELETEALLITEMS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                        "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                        "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                        "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                        "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                        "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~                Return True; To suppress subsequent $LVN_DELETEITEM messages
;~               ;Return False; To receive subsequent $LVN_DELETEITEM messages
;~            Case $LVN_DELETEITEM; An item is about to be deleted
;~                Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~                _DebugPrint("$LVN_DELETEITEM" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                        "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                        "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                        "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                        "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                        "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~               ; No return value
;~            Case $LVN_ENDLABELEDIT; The end of label editing for an item
;~                Local $tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
;~                Local $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
;~                _DebugPrint("$LVN_ENDLABELEDIT" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
;~                        "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
;~                        "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
;~                        "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
;~                        "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
;~                        "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
;~                        "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
;~                        "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
;~                        "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
;~                        "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
;~               ; If Text is not empty, return True to set the item's label to the edited text, return false to reject it
;~               ; If Text is empty the return value is ignored
;~                Return True
;~            Case $LVN_ENDSCROLL; A scrolling operation ends, Minium OS WinXP
;~                Local $tInfo = DllStructCreate($tagNMLVSCROLL, $ilParam)
;~                _DebugPrint("$LVN_ENDSCROLL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->DX:" & @TAB & DllStructGetData($tInfo, "DX") & @LF & _
;~                        "-->DY:" & @TAB & DllStructGetData($tInfo, "DY"))
;~               ; No return value
;~            Case $LVN_GETDISPINFO; Provide information needed to display or sort a list-view item
;~                Local $tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
;~                Local $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
;~                _DebugPrint("$LVN_GETDISPINFO" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
;~                        "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
;~                        "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
;~                        "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
;~                        "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
;~                        "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
;~                        "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
;~                        "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
;~                        "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
;~                        "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
;~               ; No return value
;~            Case $LVN_GETINFOTIP; Sent by a large icon view list-view control that has the $LVS_EX_INFOTIP extended style
;~                Local $tInfo = DllStructCreate($tagNMLVGETINFOTIP, $ilParam)
;~                Local $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
;~                _DebugPrint("$LVN_GETINFOTIP" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags") & @LF & _
;~                        "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
;~                        "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam"))
;~               ; No return value
;~            Case $LVN_HOTTRACK; Sent by a list-view control when the user moves the mouse over an item
;~                Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~                _DebugPrint("$LVN_HOTTRACK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                        "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                        "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                        "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                        "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                        "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~                Return 0; allow the list view to perform its normal track select processing.
;~               ;Return 1; the item will not be selected.
;~            Case $LVN_INSERTITEM; A new item was inserted
;~                Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~                _DebugPrint("$LVN_INSERTITEM" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                        "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                        "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                        "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                        "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                        "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~               ; No return value
;~            Case $LVN_ITEMACTIVATE; Sent by a list-view control when the user activates an item
;~                Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
;~                _DebugPrint("$LVN_ITEMACTIVATE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                        "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                        "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                        "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                        "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                        "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
;~                        "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
;~                Return 0
;~            Case $LVN_ITEMCHANGED; An item has changed
;~                Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~                _DebugPrint("$LVN_ITEMCHANGED" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                        "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                        "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                        "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                        "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                        "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~               ; No return value
;~            Case $LVN_ITEMCHANGING; An item is changing
;~                Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~                _DebugPrint("$LVN_ITEMCHANGING" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                        "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                        "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                        "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                        "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                        "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~                Return True; prevent the change
;~               ;Return False; allow the change
;~               Case $LVN_KEYDOWN; A key has been pressed
;~                   Local $tInfo = DllStructCreate($tagNMLVKEYDOWN, $ilParam)
;~                   _DebugPrint("$LVN_KEYDOWN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                           "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                           "-->Code:" & @TAB & $iCode & @LF & _
;~                           "-->VKey:" & @TAB & DllStructGetData($tInfo, "VKey") & @LF & _
;~                           "-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags"))
;~                  ; No return value
;~            Case $LVN_MARQUEEBEGIN; A bounding box (marquee) selection has begun
;~                _DebugPrint("$LVN_MARQUEEBEGIN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode)
;~                Return 0; accept the message
;~               ;Return 1; quit the bounding box selection
;~            Case $LVN_SETDISPINFO; Update the information it maintains for an item
;~                Local $tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
;~                Local $tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
;~                _DebugPrint("$LVN_SETDISPINFO" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode & @LF & _
;~                        "-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
;~                        "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~                        "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                        "-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
;~                        "-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
;~                        "-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
;~                        "-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
;~                        "-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
;~                        "-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
;~                        "-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
;~                        "-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
;~                        "-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
;~                        "-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
;~               ; No return value
                Case $NM_CLICK; Sent by a list-view control when the user clicks an item with the left mouse button
                    Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
;~                  _ListSkillsWithKeyword(DllStructGetData($tInfo, "Index"))
                    _DebugPrint("$NM_CLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
                            "-->Code:" & @TAB & $iCode & @LF & _
                            "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
                            "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
                            "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
                            "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
                            "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
                            "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
                            "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
                            "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
                            "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
                   ; No return value
;~               Case $NM_DBLCLK; Sent by a list-view control when the user double-clicks an item with the left mouse button
;~                   Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
;~                   _DebugPrint("$NM_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                           "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                           "-->Code:" & @TAB & $iCode & @LF & _
;~                           "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
;~                           "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                           "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                           "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                           "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                           "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                           "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                           "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
;~                           "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
;~                  ; No return value
;~            Case $NM_HOVER; Sent by a list-view control when the mouse hovers over an item
;~                _DebugPrint("$NM_HOVER" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                        "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                        "-->Code:" & @TAB & $iCode)
;~                Return 0; process the hover normally
;~               ;Return 1; prevent the hover from being processed
;~               Case $NM_KILLFOCUS; The control has lost the input focus
;~                   _DebugPrint("$NM_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                           "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                           "-->Code:" & @TAB & $iCode)
;~                  ; No return value
;~               Case $NM_RCLICK; Sent by a list-view control when the user clicks an item with the right mouse button
;~                   Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
;~                   _DebugPrint("$NM_RCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                           "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                           "-->Code:" & @TAB & $iCode & @LF & _
;~                           "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
;~                           "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                           "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                           "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                           "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                           "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                           "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                           "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
;~                           "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
;~                  ;Return 1; not to allow the default processing
;~                   Return 0; allow the default processing
;~               Case $NM_RDBLCLK; Sent by a list-view control when the user double-clicks an item with the right mouse button
;~                   Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
;~                   _DebugPrint("$NM_RDBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                           "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                           "-->Code:" & @TAB & $iCode & @LF & _
;~                           "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
;~                           "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~                           "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~                           "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~                           "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~                           "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~                           "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~                           "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
;~                           "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
;~                  ; No return value
;~               Case $NM_RETURN; The control has the input focus and that the user has pressed the ENTER key
;~                   _DebugPrint("$NM_RETURN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                           "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                           "-->Code:" & @TAB & $iCode)
;~                  ; No return value
;~               Case $NM_SETFOCUS; The control has received the input focus
;~                   _DebugPrint("$NM_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~                           "-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~                           "-->Code:" & @TAB & $iCode)
;~                  ; No return value
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc  ;==>WM_NOTIFY

Func _DebugPrint($s_text, $line = @ScriptLineNumber)
    ConsoleWrite( _
            "!===========================================================" & @LF & _
            "+======================================================" & @LF & _
            "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
            "+======================================================" & @LF)
EndFunc  ;==>_DebugPrint

by clicking on any of the items in the listviews enough times the script eventually freezes up. I've discovered that by bringing another app (FireFox in particular) into focus over the gui, then bringing the gui back, unfreezes it.

Can anyone help? Is this just a 'learn to live with it / you're asking too much' situation???

Share this post


Link to post
Share on other sites

You are using old version of AutoIt. This issue was fixed way back.

I don't understand why quite a lot of ppl miss the obvious fact that before posting any questions about bugs (or any issues actually), they should make sure to have the latest version installed. Seems like common sense to me...


"be smart, drink your wine"

Share this post


Link to post
Share on other sites

Really?? That's it? D'oh!

I thought I *was* using the latest ver. (well, 3.2.12).

And bugger me, I quick @AutoItVersion shows 3.2.10! I must be using 3.2.12 at work, and forgotten to update at home.

Wow that's embarrassing!

Thanks... :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0