A_GuiEvent

Get help with using AutoHotkey and its commands and hotkeys
labrint
Posts: 135
Joined: 14 Jun 2017, 05:06

A_GuiEvent

21 Nov 2019, 04:28

Consider the following function which controls listview tables.

Code: Select all

ListCtrlEvent(ctrlHwnd:=0, guiEvent:="", eventInfo:="", errLvl:="") {

	If A_GuiEvent
	LvSel := A_GuiControl

	GuiControlGet, ctrlName, Name, %CtrlHwnd%
	
	rownumber := eventInfo
	
	    If (guiEvent = "DoubleClick") {
	    	Thread, NoTimers , True
	;eventInfo ;event info is rownumber
	
	If ctrlName = MyFirstListView
	{
	Gui, ListView, MyFirstListView
	LV_GetText(Desc,eventInfo,1)
	LV_GetText(Qty,eventInfo,2)
	;Set of instructions
	    }
	    
	    If (guiEvent = "Normal") {
	    	Thread, NoTimers , True
			;eventInfo ;event info is rownumber
	If ctrlName = MyFirstListView
	{
	Gui, ListView, MyFirstListView
	LV_GetText(Desc,eventInfo,1)
	LV_GetText(Qty,eventInfo,2)
	    ;Set of instructions
	    }
	    
	  }
	    	   
Whenever I click on the row of the listview I get the guiEvent normal triggered, which is what I want, but when I double click, the guiEvent normal is overriding the doubleclick and I have to mouse click zillion times to get it to work. I tried to put in keywaits and the following code to distinguish between them

Code: Select all

If (A_TimeSincePriorHotkey<400) and (A_TimeSincePriorHotkey<>-1)
but nothing seems to work. I have used other guiEvents such as right click for other things therefore I cannot use them. I tried to use the mouseover function to get the hover to fill in but it was too memory intensive as it needs to persistently run. Please help

Return to “Ask For Help”

Who is online

Users browsing this forum: rikoski, Thoughtfu1Tux and 239 guests