Jump to content

Recommended Posts

Posted

Hi,

I'm trying to implement a double click event in a listview.  But somehow it's crashing the program.  I'm suspecting that it has something to do with DllStructGetData() function.

Im running on version 3.3.16.1

Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
    $iCode = BitShift($wParam, 16)
    Switch $lParam
        Case GUICtrlGetHandle($inputSerial)
            If $iCode = $EN_SETFOCUS Then $inputFocus = $inputSerial
        Case GUICtrlGetHandle($inputWorkSlip)
            If $iCode = $EN_SETFOCUS Then $inputFocus = $inputWorkSlip
        Case GUICtrlGetHandle($inputMain)
            If $iCode = $EN_SETFOCUS Then $inputFocus = $inputMain
    EndSwitch

    $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $iCode
        Case $NM_DBLCLK
            If $iIDFrom = $idListview Then
                _EditListItem(_GUICtrlListView_GetItemText($idListview, _GUICtrlListView_GetHotItem($idListview)))
            EndIf
    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

 

Posted
21 minutes ago, Jos said:

Post a runnable replicatie script and the details of the crash as it will be hard to assist without them.

I don't understand what a "runnable replicatie script" is.  Please explain.  When I run the script, the program just hangs and then it self terminate.

Posted
3 hours ago, l4tran said:

I'm trying to implement a double click event in a listview

For this you should use WM_NOTIFY - and btw have a look to the example for _GUICtrlListView_Create in the help file

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...