Oh well, doesn't seem anyone going to give any answer, mods, please lock it.
I got it to do what I need, so it's closed for discussion.
Some background first what I been working on.
Guess not a secret EO client is standard Windows program with just some DirectX added. So far from what I have seen bot programming has gone into 2 directions:
1) decoding communications and controlling the network traffic
2) auto-clickers
There are problems with both - if TQ make changes to communications, it needs to be detected. Also could be they introduce specific packets generated at random in order to catch such bots.
And with 2nd problem is - you cannot use the computer while bot is running, also depending how good your bot is, you possibly may not know on what you are clicking and if you can click already or not (I mean, if you can read anything back from client, or just clicking at given coordinates at given speed).
What I have attempted is bit different auto-clicker - not by controlling mouse, but controlling the client controls through Windows API. I succeeded pretty good. What I can do such way is controlling any control for any client, including mannequins, even if they are in background. Means, is possible to make auto-talker, auto-boother, auto-auctioneer, auto-bidder etc. etc.
Technically - anything that has direct control to work with.
What I tried and failed:
1) clicking on dialogues (NPC, event items etc) - for some strange reason it works for main process in all ways - foreground/background, but does not for sub-processes (e.g., mannequins) at all. I have checked processes, windows, controls, coordinates - everything is correct. I do send correct message to correct control. But the control just ignores message as if it was invalid. And of course it works when I emulate mouse click with MOUSE_EVENT, but that is not what I want to achieve.
Problem reason with dialogs is - they are graphics. The texts, options and their coordinates I can read from memory, no problem there. Problem is, the output in client is graphics, not windows control, so I have to send WM_LBUTTONDOWN at X,Y to dialog window, not direct control.
2) clicking on main area (graphics) - does not work at all for me. OK, same old story it does not work for sub-processes, but it also does not work for main process. For main it is bit different - it does handle the message, but the crap is, it does not work as expected. I.e., I send the click on NPC, but instead of that it processes message as if I clicked on the ground behind NPC.
Anyone has worked with this stuff and willing to give me some tips where I am doing something wrong?
And yeah, it is not that much EO related, but API in general.
Added
What I haven't tried yet (might do today if I find time) - trying messaging to main handle and hoping it will deliver message to the right control.