Check this post (from a long time ago). The example assumes though that your first program spawns the second one.