Sign in to follow this  
Followers 0
DirtDBaK

Listviews... How do i know if someone dbl clicked?

5 posts in this topic

i have a media player that i have been working on, im not very good at puting together the gui, but it works for me, any ways i want detailed information sorted in a listview but if i double click it nothing happens how can i fix this? If you want my source its http://65.185.106.128%20/DDB/Source.txt hope someone can help...


[center][/center]

Share this post


Link to post
Share on other sites



script snippets:

GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events")

Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam)
    #forceref $hWndGUI, $MsgID, $wParam
    Local $tagNMHDR, $event
    
    If $wParam = $ListView1 Then
        $tagNMHDR = DllStructCreate("int;int;int", $lParam)
        If @error Then Return
        $event = DllStructGetData($tagNMHDR, 3)
        
        If $event = $NM_DBLCLK Then OnDoubleclick()
    EndIf
EndFunc

Func OnDoubleclick()
    $col1 = _GUICtrlListViewGetItemText($ListView1,_GUICtrlListViewGetCurSel($ListView1),0)
    If $col1 = -1 Then Return

    ; do what you want here ...
EndFunc

Share this post


Link to post
Share on other sites

I can't remember whi wrote this maybe gafrost?

Global Const $WM_NOTIFY = 0x004E
Global $debug = 1
#include <GuiConstants.au3>
$Form1 = GUICreate("", 633, 467, -1, -1)

;Main listview which accepts droped items
$ListView1 = GUICtrlCreateListView("Stuff|Stuff|Stuff|and more stuff", 30, 54, 573, 300,-1)
GUICtrlSendMsg($ListView1, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)


GUISetState()

GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events")

Do
    Sleep (10)
    
Until GuiGetMsg() = $GUI_EVENT_CLOSE






Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam)
    #forceref $hWndGUI, $MsgID, $wParam
    Local Const $NM_FIRST = 0
    Local Const $NM_CLICK = ($NM_FIRST - 2)
    Local Const $NM_DBLCLK = ($NM_FIRST - 3)
    Local $tagNMHDR, $event, $hwndFrom, $code
    $tagNMHDR = DllStructCreate("int;int;int", $lParam);NMHDR (hwndFrom, idFrom, code)
    If @error Then Return
    $event = DllStructGetData($tagNMHDR, 3)
    Select
        Case $wParam = $ListView1
            Select
                Case $event = $NM_CLICK
                    ListView_Click()
                Case $event = $NM_DBLCLK
                    ListView_DoubleClick()
            EndSelect
    EndSelect
    $tagNMHDR = 0
    $event = 0
    $lParam = 0
EndFunc  ;==>WM_Notify_Events

Func ListView_Click()
;----------------------------------------------------------------------------------------------
    ConsoleWrite("$NM_CLICK" & @crlf)
;----------------------------------------------------------------------------------------------
EndFunc  ;==>ListView_Click

Func ListView_DoubleClick()
;----------------------------------------------------------------------------------------------
    ConsoleWrite("$NM_DBLCLK"& @crlf)
;----------------------------------------------------------------------------------------------
EndFunc  ;==>ListView_DoubleClick

Share this post


Link to post
Share on other sites

thnaks for the help ill try it out!


[center][/center]

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