I run chdkptp from an autohotkey script ( http://www.autohotkey.com ).
OK, that clarifies things a bit, I assumed you had actually written program in some other language to run chdkptp.
Based on
http://www.autohotkey.com/docs/Tutorial.htm#Send it looks you should be able to send keystrokes to a running copy of chdkptp, something like
Send =shoot()
From
http://www.autohotkey.com/docs/Tutorial.htm#Activate you should be able to switch between windows.
So instead of starting chdkptp each time, you could
1) start two copies of chdkptp in interactive mode, with their respective connect strings but no shoot
C:\chdkptp-r291-win32\chdkptp -i -c"-p=____"
C:\chdkptp-r291-win32-copy\chdkptp -i -c"-p= _ _ _"
2) When you want to shoot, switch to each window and send "=shoot()". It looks like you should be able identify each window by it's path
---
Alternative way, using the multicam module. This uses one copy of chdkptp to control both cameras, and shots should be very close together. I've attached two cli command files. To use them, put the files in the same directory as chdkptp. The lines that start with # are comments.
Start chdkptp with
chdkptp -i -rmcinit.chdkptp
This makes chdkptp run all the commands in mcinit.chdkptp at startup.
The commands in the file
1) load the multicam module
2) connect to all cameras that are connected to your pc
3) start the multicam script all cameras
4) Initialize the time synchronization system
5) switch the cameras to shooting mode.
To shoot
source mcshoot.chdkptp
This will press half shoot, wait for the cameras to focus etc, and then send the shoot command.
when you are done, you should send
!mc:cmdwait('exit')
to end the multicam script on the cameras. If you disconnect without doing this (and don't restart the cameras), the next time you connect you'll get errors because the script is already. You will also need to use 'exit' if you want to download files with mdownload.
The whole mc module isn't really finished, but maybe you will find it useful.