Code: Select all
VarSetCapacity(RECT, 16, 0)
SendMessage, % LB.GETITEMRECT, %TopIndex%, &RECT, , ahk_id %hWnd%
Txt := ...
TextColor := ...
Len := StrLen(Txt)
DllCall("Gdi32.dll\SetTextColor", "Ptr", LBDC, "UInt", TextColor)
NumPut(NumGet(RECT, 0, "Int") + 3, RECT, 0, "Int")
DllCall("User32.dll\DrawText", "Ptr", LBDC, "Ptr", &Txt, "Int", Len, "Ptr", &RECT, "UInt", 0x0840)
NumPut(NumGet(RECT, 0, "Int") - 3, RECT, 0, "Int")
DllCall("User32.dll\OffsetRect", "Ptr", &RECT, "Int", 0, "Int", This.ItemHeight)
Code: Select all
Gui, Add, Text, hwndhWnd vhWnd, Ask For Help
; ----------------------------
VarSetCapacity(RECT, 16, 0)
SendMessage, ??? ???, &RECT, , ahk_id %hWnd%
How I could get it? It does need to be a Rect to I be able to use it with the following lines of code, that draw a text inside a DC