I am currently trying to retrieve a certain item in a listbox by
passing in the window handle and the string value of the item I am
looking for. I know that once I have the window handle of the listbox
I can retrieve the item where it matches the string value I passed in
to the method. Once I retrieve the correct item I want to be able to
highlight that item, but the problem is that I do not know the correct
syntax for this to happen. The code is not compiling correctly. If
someone could please help me out with this simple task I would
appreciate it.
void CListBoxTest::TestHighLight( HWnd hwnd, string value )
{
int itemValue = SendMessage( hwnd, LB_FINDSTRINGEXACT, -1, value );
//To add the code here for highlighting listbox item once the index
is found
}