Interact
-
Hello. Can you tell me how can I make my C# application interact with other C# or win32 applications. Thank you. I want for example to be able to get the data from a notepad or a cmd window. Thank you.
The other application has to be designed for such interaction. You can force interaction, but there is no consitent way to do that because you have to trick the application into interacting with your application. There are ways of getting properties of windows (e.g. controls), for example, the Text property of the TextBox control that Notepad (I assume) is using. However, it has been a few years since I did any C++ and I don't enough to be able to work out how it might be done any more. The Command window might be easier to deal with as the application is just interacting with StdIn, StdOut and StdErr and these can be redirected. See the System.Diagnostics.Process[^] class
My: Blog | Photos "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
-
The other application has to be designed for such interaction. You can force interaction, but there is no consitent way to do that because you have to trick the application into interacting with your application. There are ways of getting properties of windows (e.g. controls), for example, the Text property of the TextBox control that Notepad (I assume) is using. However, it has been a few years since I did any C++ and I don't enough to be able to work out how it might be done any more. The Command window might be easier to deal with as the application is just interacting with StdIn, StdOut and StdErr and these can be redirected. See the System.Diagnostics.Process[^] class
My: Blog | Photos "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious