Sometimes you just have to do the math yourself.
Let’s say I’m running a program in a 1000x1000 window. (Goofy size, but easy numbers.). Now, let’s say I designate the top right 250x250 area as a mini “preview” window of sorts, but I want to interact with it as a 1000x1000 coordinate window, as well...
The mouse position is relative to the main window, so if it’s halfway in that 250x250 area, it’d be at point (875,125).
To calculate relative position, I’d just:
WindowMouseX = (_MOUSEX - WindowLeftPosition) * (WindowCoordinateWidth/ ActualWindowWidth)
WindowMouseY = (_MOUSEY - WindowTopPosition) * (WindowCoordinateHeight / ActualWindowHeight)
So the WindowMouseX would be (875 - 750) * (1000 / 250) = (125) * (4) = 500
And WindowMouseY would be (125 - 0) * (1000 / 250) = (125) * (4) = 500
And, in the mini-window, point (500,500) is indeed the center of the designated 1000x1000 coordinate system, which overall would be at (875, 125) on the main screen.
Just don’t forget to error check...
IF WindowMouseX < 0 OR WindowMouseX > 1000 OR WindowMouseY < 0 OR WindowMouseY > 1000 THEN ‘Result is not inside preview window. Skip any preview click results...