Forum Discussion
HKosova
9 years agoSmartBear Alumni (Retired)
You can use Sys.Desktop.MouseDown() and .MouseUp() with the appropriate delay. The target object must be visible on the screen.
// Get screen coordinates of the point to click, e.g. the object's center var p = obj.WindowToScreen(obj.Width/2, obj.Height/2);
Sys.Desktop.MouseDown(VK_RBUTTON, p.X, p.Y); Delay(1000); // ms Sys.Desktop.MouseUp(VK_RBUTTON, p.X, p.Y);
- pyatakov9 years agoOccasional Contributor
I prefer to use this method
var p = obj.WindowToScreen(-1, -1);
than this
var p = obj.WindowToScreen(obj.Width/2, obj.Height/2);
- HKosova9 years agoSmartBear Alumni (Retired)
pyatakov wrote:
I prefer to use this method
var p = obj.WindowToScreen(-1, -1);
than this
var p = obj.WindowToScreen(obj.Width/2, obj.Height/2);
These are different things. WindowToScreen handles (-1, -1) as a point 1 pixel away from the object, whereas (obj.Width/2, obj.Height/2) is the object's center point.
- pyatakov9 years agoOccasional Contributor
Nope,
(-1, -1) - It was available in TC 6.5 for click center :)
I start using TC 6.1
Related Content
- 5 years ago
- 2 years ago
Recent Discussions
- 2 days ago