I’m automating meta trader issues. I need to select an item on a syslistview32 (Listview) using sendmessage in C#. Anybody could help me?
Prateek
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The ListView messages are documented here.
The easiest way is probably using the
LVM_SETITEMSTATEmessage. It receives a pointer to aLVITEMstruct, so it may take some marshalling skills.The actual fields to be set are actually easy:
mask = LVIF_STATEstate = LVIS_SELECTED | LVIS_FOCUSEDstateMask = LVIS_SELECTED | LVIS_FOCUSEDiItem = <the index of the item to be selected>That should be enough to select the item you want.