Jump to content

how to get data when double clicked in a gui control list


seres
 Share

Recommended Posts

hello, im trying to get data inside a gui control list when double clicked but i cant get it to work here is what i got so far

#include <GuiConstants.au3>


Global $DoubleClicked   = False

GUICreate("Double Click Demo", 400, 300)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")


$List = GUICtrlCreateList("List Column", 10, 20, 350, 250)
GUICtrlSetData(-1, "double click me for a msgbox")


GUISetState()

While GUIGetMsg() <> -3
    Sleep(10)
    If $DoubleClicked Then
        DoubleClickFunc()
        $DoubleClicked = False
    EndIf
WEnd


Func DoubleClickFunc()
    MsgBox(64, "OK", "Data selected is: " & GUICtrlRead($List))
EndFunc


Func WM_NOTIFY($hWnd, $MsgID, $wParam, $lParam)
    Local $tagNMHDR, $event, $hwndFrom, $code
    $tagNMHDR = DllStructCreate("int;int;int", $lParam)
    If @error Then Return 0
    $code = DllStructGetData($tagNMHDR, 3)
    If $wParam = $List And $code = -3 Then $DoubleClicked = True
    Return $GUI_RUNDEFMSG
EndFunc

 

Link to comment
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
 Share

  • Recently Browsing   0 members

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