Board index » delphi » Getting a value from another running program

Getting a value from another running program

Using delphi 1 I wish to find out if a certain program is running
already and if so retrieve some data from itm for use in the second
program.

Both files program 1 and program 2 are written in delphi 1 on win 95

e.g

run program 1

set x to a value

run program 2

{in program 2}

If running(program 1)
get value of x from program 1
use x

do other stuff

end program 2

end program 1

Q1 how do i get a handle to program 1  ?

Q2 how can i retrieve the value of X from program 1 ?

Thanks in advance .

 

Re:Getting a value from another running program


Quote
Colin Petrie <Colin.Pet...@onyxnet.co.uk> wrote:
>Using delphi 1 I wish to find out if a certain program is running
>already and if so retrieve some data from itm for use in the second
>program.
>Q1 how do i get a handle to program 1  ?
>Q2 how can i retrieve the value of X from program 1 ?

Q1: Create some unique class name for program 1 main form and  use FindWindow in
program 2. Eventually, (assuming program 1 is single instancve app) Program 1
can on start write somewhere (for instance to Registry) the value of its main
form's handle and remove it on exit.

Q2: You have to define user defined WM_ commands applications will send between
each other. You have to define your own protocol.
Lester

lko...@ottawa.com
http://www.{*word*104}us.ca/~lkovac/lester.htm

Other Threads