Here you go, the sendmessage api (just found it on the first page of google..)
Also google on spy++ for this
BTW I don't know if you can use the sendmessage function with the sro client actually. (Didn't find any useful things while looking with spy++ at the sro client.)
So I think you are bound to sendkeys, or use a proxy like bots do (correct me if i'm wrong)