I'm looking to put a combobox into a subitem when the user clicks on it.
I've got most of it.

I'm sending LVM_SUBITEMHITTEST to find out which subitem I'm over. I then
loop through the columnwidths using LVM_GETCOLUMNWIDTH adding them all up to
subitem-1. Then I get the width of the subitem column. All good and well.
Got the left and width, set the font to the same as the listview to get the
height. Can't get the top position correct.

Here's the bulk of the code. I'm sure there's got to be a better way...

Dim lLeft As Long
Dim lWidth As Long
Dim lTop As Long
Dim icnt As Integer
Dim r As Long

ClientToScreen ListView1.hwnd, lvPt
SendMessage ListView1.hwnd, LVM_GETITEMRECT,
ListView1.SelectedItem.Index, lsRect
SendMessage ListView1.hwnd, LVM_GETSUBITEMRECT, HTI.iSubItem,
For icnt = 0 To HTI.iSubItem - 1
lLeft = lLeft + SendMessage(ListView1.hwnd, LVM_GETCOLUMNWIDTH,
CLng(icnt), 0)
lWidth = SendMessage(ListView1.hwnd, LVM_GETCOLUMNWIDTH,
CLng(HTI.iSubItem), 0)
lLeft = ((lLeft * Screen.TwipsPerPixelX) + lvPt.X) - 10
lTop = ((HTI.iItem - (ListView1.GetFirstVisible.Index - 1)) *
(lsRect.Bottom - lsRect.Top)) * Screen.TwipsPerPixelY

Combo1.Move lLeft, (lsRect.Top + lvPt.Y) * Screen.TwipsPerPixelY,
lWidth * Screen.TwipsPerPixelX
Combo1.Visible = True


-George Handlin
ref# 587968