Hi
Thanks for your reply. The listview is in another process. I can use
SendMessage to get information from a RichTextBox and a ComboBox. I was
very much hoping i could do the same with the listview. To be honest, i
am fairly new to Win32 so it is probably the basics i have got wrong.
Would it be possible to list the steps i would need to take to make this
work. Currently, my calling code is:
internal unsafe int ListView_FindItem(IntPtr lv, int iStart,
ref LVFINDINFO lvfi)
{
LVFINDINFO_INTERNAL lvfii = new LVFINDINFO_INTERNAL();
lvfii.flags = lvfi.flags;
lvfii.lParam = lvfi.lParam;
lvfii.vkDirection = lvfi.vkDirection;
lvfii.pt = new POINT();
lvfii.pt.x = lvfi.pt.X;
lvfii.pt.y = lvfi.pt.Y;
if(lvfi.psz != null)
{
fixed(char* ptr = lvfi.psz.ToCharArray())
{
lvfii.psz = ptr;
return SendMessage(lv, (int)LVM.FINDITEM, (uint)iStart,
new IntPtr(&lvfii).ToInt32());
}
}
return SendMessage(lv, (int)LVM.FINDITEM, (uint)iStart,
new IntPtr(&lvfii).ToInt32());
}
public string FindInfo( IntPtr listView, string find )
{
LVFINDINFO lvfi = new LVFINDINFO();
lvfi.flags = LVFI.PARTIAL;
lvfi.psz = "A";
int returned = ListView_FindItem(listView, -1, ref lvfi);
return lvfi.psz;
}
It compiles and runs without error (apart from the lack of output), so
am assuming all my definitions are ok.
Am i correct in assuming lvfi.psz should contain the text an the return
value of SendMessage contain the index!?
Many thanks for your help
Dave
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!