The macro still returns FALSE.
1.Can you please let me know what would be the possible mistakes I would have done.
2.Is there any macro to click an item in listview or can you help/guide me regarding this.
Sir I am developing an automation tool for which I need to click on the item in the listview. As there is no macro for directly clicking on listview item.One of my colleague suggested me, " to get the listview item size using ListView_GetItemRect and then try to convert it to X,Y mouse point and click on it".But I am completely blank. Please help me and sorry for disturbing you a lot sir.
I am calling in the same process.
Things I have done:
//I am getting 20 in ix.Also I have checked it manually.
BOOL bRet = ListView_GetItemRect(e3Obj.eHwnd, 3, &rec, LVIR_BOUNDS);
Sir also let me know am I following the correct way to click on the item in listview or is there some other way.
Last edited by haroonrulz; January 10th, 2013 at 08:52 AM.
Should I say it that I already warned you in the other thread?
Originally Posted by haroonrulz
I am new to Windows programming and I am trying to click an item in listview control for that I need to take the rect size of the listview.Can anyone help me regarding ListView_GetItemRect macro.
Your problem is not the macro. Your problem is that you hardly understand how Windows controls work. You're looking for some magic macro while there is no one in your specific case.
Originally Posted by haroonrulz
Sir I am developing an automation tool for which I need to click on the item in the listview. As there is no macro for directly clicking on listview item.One of my colleague suggested me, " to get the listview item size using ListView_GetItemRect and then try to convert it to X,Y mouse point and click on it".But I am completely blank.
So you're not prepared enough for completing this task. You cannot develop anything complex in Windows being completely blank and new to Windows programming.
Now to your assignment.
It may be solved two different ways. First is code injection. This (writing code to remote process and creating remote thread) or that (injecting dll) way your code have to appear in the context of the process you to automate. Then by means of some IPC (inter-process communication) your code gets the command 'click on item 3', gets the corresponding item rect (by means of the macro, or sending LVM_GETITEMRECT, whatever), positions mouse cursor inside the rect, emulates left button down and button up events. I repeat: All this code is inside the victim process.
Second way implies no code injection, but ability to read/write the victim process memory is mandatory anyway. The automation process allocates remote memory enough to fit RECT in and passes the remote address to the macro, then it reads the rect coordinates and emulates the mouse button click as explained above. And does not forget to deallocate later, of course.
This is how it looks from "helicopter view". A special headache is acquiring rights enough to read/write remote process memory or inject dll, as since Vista times Microsoft decided to make this kind of tricks be much more tricky than it was before.
Now can anybody explain me how this could be done by somebody who's completely blank and new to Windows programming? Guys, if you really need some automation engine, you'd better go with already proved solutions like AutoIt
Last edited by Igor Vartanov; January 11th, 2013 at 07:45 AM.