Starting a 3rd party program in an opencv window and controlling mouse clicks from my program

you only need the position / size of that window, not “physical access” to it
and you’ll need to transform coords from

camera -> screen -> game window