The requirement is extremely simple. Here's how my script will work.
1) run my script.
2) run your program, wait for the window to appear.
3) place the mouse cursor where you want to click. But don't click. Just place the cursor there so the script knows where you want to click.
4) press hotkey#1 (say ctrl-shift-F9, can be anything you want). The script automatically captures the name of the window and the position of the mouse cursor in the window. This is saved in an ini file.
5) now reload the script (right click on the H icon in the system tray near the clock). The script detects that the ini file is present, and goes into the loop, waiting for the window to appear, and click once on that position.
If you want to click a different position or different window name, just delete the ini file, and run the script again.