 <p>That's a bit broad... the general logic, would be to use the API of whatever you're interfacing with.</p> <p>This would vary depending on what indeed it is you're dealing with - the general logic is going to be <em>completely</em> different for a 3D application compared to a 2D windowing system. Again, if you're dealing with a 2D application is this application full screen, so you only have to consider absolute X,Y values - or is it under a windowing system in which case you care more about X,Y in relation to the window as opposed to the entire screen.</p>