Upgraded W8 to W10 touch problem OT?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
PuzzledGreatly
Posts: 1303
Joined: 29 Sep 2013, 22:18

Upgraded W8 to W10 touch problem OT?

10 Apr 2021, 07:36

Apologies fo the length of this post. I have a gui with three list views the contents of which are set by using a treeview. The idea is that when an item in a list view is selected it will find the full path to the file and run it. Here's the code for glabel for the listviews:

Code: Select all

ViewIt()
{
	Global Tree
	static r
	
	if instr(A_Guievent, "Normal")
	{	
		loop, 3
		{
			if instr(A_guicontrol, A_index)
			continue
			Gui, dash:listview, Box%A_index%
			LV_Modify(0, "-Select")
		}
	
		Gui, dash:listview, %A_guicontrol%

		LV_GetText(r, A_EventInfo,2)
		
		Gui, dash:listview, %A_guicontrol%		
		msgbox, 4096, r, % r

		if instr(substr(r, -3), "exe")
		LoadGame(r)		
		if instr(substr(r, -3), "mp3")
		LoadAudio(r)		
		if instr(substr(r, -3), "mp4")
		LoadVideo(r)
		if instr(substr(r, -3), "png")
		LoadImage(r)
		;GuiControl, Dash:Focus, Tree 		
	}

	Return
}
The istviews use x2000 so they don't have scrollbars but I also have two buttons that act as a kind of scroll for changing the files put into the list views. Here's that code:

Code: Select all

Scroll(i:="")	;i = reset (the treeview was used to load a new folder)
{
	Global
	static temp
	
	pag := i ? 0 : pag
	
	if instr(A_GuiControl, "scrob")
	pag := pag = 0 ? Lis.length() - (rws * 3) : pag - (rws * 3) < 0 ? 0 : pag - (rws * 3)
	if instr(A_GuiControl, "scrof")
	pag := pag = Lis.length() - (rws * 3) ? 0 : pag + (rws * 3) > LIS.length() - (rws * 3) ? Lis.length() - (rws * 3) : pag + (rws * 3) 

	chk := 0
	lay := Lis.clone()
	
	loop 3
	{
		Gui, Dash:listview, box%A_index%
		LV_delete()	
	}
	;msgbox, 4096, %pag%, % A_GuiControl ": " Lis.length()
	loop % pag
	Lay.removeat(1)
	
	temp = 1
	loop, % rws * 3 ;rws is the number of lines the listview can display.
	{
		if temp = 4
		break
		
		; if ! lay.length()
		; lay := LIS.clone()
			
		Gui, listview, box%temp%
		line := Lay.removeat(1)
		SplitPath,line,,,, nax
		Lv_add("",nax,line)
		LV_modifycol(1,box)
		LV_modifycol(2,0)
			
		if !mod(A_index, rws)
		temp ++
		
		if (A_index > LIS.length())
		break
	}

	return
}
My code is working on W10 machines but when using a W8 machine that was upgraded to W10 it half fails. If use the scroll button and then click on an item in a listview using a mouse or pen the code works but if I use the touch screen the msgbox in the ViewIt function never fires and the program hangs. Is there anything I can do to try to make make the Windows touch work? For the situation the whole gui is supposed to work in touchscreen functions are essential. Thanks, and apologies again for the length.
User avatar
PuzzledGreatly
Posts: 1303
Joined: 29 Sep 2013, 22:18

Re: Upgraded W8 to W10 touch problem OT?

13 Apr 2021, 21:52

In case anyone else encounters this problem I found a solution as follows:

1. Avoid using altsubmit for the listview.
2. Monitor leftclicks and send a double click when it is on an item in the listview

So for the code in the initial post I added the following:

Code: Select all

~lbutton:: WatchList()

WatchList()
{
	Global
	static cdx, cdy
	
	keywait, lbutton
	
	if !WinActive("Ahk_id" Dash)
	return
	MouseGetPos, cdx, cdy
	
	abox := ""
	loop, 3
	{
		guicontrolget, box%A_index% , Dash:pos
		If (cdx > box%A_index%x && cdx < box%A_index%x + box%A_index%w && cdy > box%A_index%y && cdy < box%A_index%y + box%A_index%h)
		{
			abox := a_index
			break
		}
	}
	
	if abox
	click 2

	return
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Lamron750 and 249 guests