@Rohwedder thank you works fine , tried with 4K monitor , dependig font must define rowheight
added example , with F7 show row 7
Code: Select all
;- Detecting scroll position of listview
;- https://www.autohotkey.com/boards/viewtopic.php?f=76&t=85857
Gui,1:default
Gui,-dpiscale
Gui,1:Font,s12,Lucida Console
gui,add,listview,vgLV gLW2 w500 h800 x50 y10 +altsubmit,ROWNUM|CONTENT
loop, 50
lv_Add("",A_Index,"TEST " . A_Index)
gui show ,w600 h900
return
;---------------
guiclose:
exitapp
;---------------
LW2:
gui,1:listview,glv
RN:=LV_GetNext("C")
RF:=LV_GetNext("F")
GC:=LV_GetCount()
if A_GuiEvent = Normal
{
LV_GetText(C1,A_EventInfo,1)
LV_GetText(C2,A_EventInfo,2)
msgbox,%c1% %c2%
}
return
;---------------
F7::
LV_Modify(RF, "-Select -Focus")
LV_Modify(7, "+Select +Focus")
RF:=LV_GetNext("F") ;- selected focused
LV_GetText(C1,RF,1)
LV_GetText(C2,RF,2)
LV_Modify(RF, "Vis") ;- scroll to row 7
; msgbox,%c1% %c2%
return
;---------------
f8:: ;-hover over 15th element
LV_Modify(7, "-Select -Focus")
ControlGetPos ,cx, cy,,, SysListView321, A
ControlGetFocus, Control, A
ControlGet, Hwnd, Hwnd,, %Control%, A
ScrollPos := DllCall("GetScrollPos", "Ptr", Hwnd, "Int", 1)
rowheight := 31
element := 15
IF (ElementPos:=1+element-ScrollPos) > 0
mouseMove,cx+40,cy+rowheight*ElementPos
Else
SoundBeep,425, 800 ;- invisible
return
;===========================================================