You should not re-post and ignore the answer you already got. Please see my comment to the question and that answer:
how to post message to a third-party appliaction in linux?[
^].
Let me explain more: processes in Linux are well isolated, and different applications are different processes. If an application is designed for collaboration with others, you should have described it. Learn if from documentation. One technique usual in Linux is piping. It is used for simple application getting text data from standard input and writing to standard output. But such application should not do anything else.
You, however, told us something about "button", that is, this is a UI application. Don't do dirty business, do something legitimate. I, for example, would first think about replacing of this unknown application with something you would write by yourself.
That's all. If you have as little information as you gave us, it means you know virtually nothing about this application, so we also know virtually nothing. This is enough to say: don't do it.
—SA