Jump to content

Why is doubleclick not working ?

Recommended Posts

I used the example for _GUICtrlTreeView_ClickItem and the debug shows single and double clicks as working. Then i removed all the stuff i don't want from the example. I also removed the WM_NOTIFY function or my example wouldn't work. Now it runs but my example only works with single click (,2 is enabled). Something to note is i had to put the full path to WM_NOTIFY.au3 or it came up with an error. Here is my script


#include <C:\Program Files\AutoIt3\Examples\Helpfile\Extras\WM_NOTIFY.au3>
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiTreeView.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <StaticConstants.au3>
#include <TreeViewConstants.au3>

Global $g_idTreeView


Func Example()
        GUICreate("TreeView Click Item", 400, 300)

        $g_idTreeView = GUICtrlCreateTreeView(2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE)

        Local $A      = GUICtrlCreateTreeViewItem("A",   $g_idTreeView)
        Local $A01    = GUICtrlCreateTreeViewItem("A01", $A)
        Local $A02    = GUICtrlCreateTreeViewItem("A02", $A)

        Local $B      = GUICtrlCreateTreeViewItem("B",   $g_idTreeView)
        Local $B01    = GUICtrlCreateTreeViewItem("B01", $B)
        Local $B02    = GUICtrlCreateTreeViewItem("B02", $B)


        Local $iMsg

        _GUICtrlTreeView_ClickItem($A01, "left", False, 2)

            While 1

            $iMsg = GUIGetMsg()

        If $iMsg = $A01 Then
            WinActivate ("Untitled - Notepad")
            Send ("A{ENTER}")

        If $iMsg = $GUI_EVENT_CLOSE Then ExitLoop


        Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example


Link to comment
Share on other sites

_WM_NOTIFY_Register() will not create a WM_NOTIFY function.  You need to provide one in order for it to work.  In fact do not use _WM_NOTIFY_Register(), it is useless, just register your own function with GUIRegisterMsg($WM_NOTIFY, WM_NOTIFY).  Note that the function is not in double-quotes, it is a better way to reference a function.

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

  • Recently Browsing   0 members

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