I am talking about windows GUI programs. Say a program-window has a dialog box (or a confirm button) asking user input. How can I provide input to that program using my program (written in say C#, Java or Python). Or say, a program window is showing some image in one of its panels. How can I grab that from other(my) program. It is a kind of impersonating (or inter-win-program messaging?). Someone told me it can be done using spy++. But how? Can you explain? What code to write? What to do with spy++?
spy++ is listening for all win32 messages. It is very useful for debugging an application but I don't think that it is a good idea to use it as an inter-process communication mechanism.
You can use win32 apis to send input to your program. As an example, You can modify the content of an edit text by using the SetWindowText function.
You need to get the handle of the window. You can use the FindWindow and the GetDlgItem to get it.
It will work for c++ and python thanks to win32 python extension. I don't know if there it is possible to use win32 api from java.