public static API_InputSimulator set_XY_OffsetToWindow(this API_InputSimulator inputSimulator, Process process) { var windowRectangle = inputSimulator.windowRectangle(process); inputSimulator.Mouse_MoveTo_X_Offset = windowRectangle.left - 10; inputSimulator.Mouse_MoveTo_Y_Offset = windowRectangle.top - 10; return(inputSimulator); }