Sending data to another process?

BlitzPlus Forums/BlitzPlus Programming/Sending data to another process?

Andres(Posted 2008) [#1]
How can i send data from one process to another? I've done it with UDP, but that's not very professional solution. For example i'de like to write a program that allows only one instance and if the instance already exists it will restore (pop up) it.


Dabhand(Posted 2008) [#2]
Say if you had one program running, you could look through all the windows that are running (either minimized or not) using WinAPI's FindWindow() function (http://msdn2.microsoft.com/en-us/library/ms633499.aspx)

You can then check for the windows class name string, or caption string... Since in Blitz+ you cannot define your own class name (Which I requested years ago) and Blitz+'s class name is the same as BlitzMax's, this turns out as a bad idea because you might 'bump' other Blitz apps.

So, your left with searching for a specific caption (Window title text), which isnt so bad, unless you want to pad the caption with other information, like maybe a file path or something.

If the window is there, either focused or not, you'll know about it.

Dabz


Andres(Posted 2008) [#3]
and now that i have the process ID, how can i send a string or something to it?