-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathLV_IsClickOnIcon.ahk
30 lines (26 loc) · 1.04 KB
/
LV_IsClickOnIcon.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
; Link: https://www.autohotkey.com/boards/viewtopic.php?t=71801
; Author:
; Date:
; for: AHK_L
/*
*/
; ----------------------------------------------------------------------------------------------------------------------
; Checks whether the left mouse button was pressed upon a check box icon
; ----------------------------------------------------------------------------------------------------------------------
LV_IsClickOnIcon(HLV, POINTS, ByRef Row, ByRef Col) {
; LVM_SUBITEMHITTEST =0x1039
Col := Row := 0
VarSetCapacity(LVHTI, 24, 0)
VarSetCapacity(PTS, 4, 0)
NumPut(POINTS, PTS, "Int")
NumPut(NumGet(PTS, 0, "Short"), LVHTI, 0, "Int")
NumPut(NumGet(PTS, 2, "Short"), LVHTI, 4, "Int")
If (DllCall("SendMessage", "Ptr", HLV, "UInt", 0x1039, "Ptr", 0, "Ptr", &LVHTI, "Int") <> -1) {
If (NumGet(LVHTI, 8, "UInt") = 2) { ; Flags: LVHT_ONITEMICON = 2
Row := NumGet(LVHTI, 12, "Int") + 1 ; Item
Col := NumGet(LVHTI, 16, "Int") + 1 ; SubItem
Return True
}
}
Return False
}