Forum Discussion
6 Replies
Sort By
- baxatobCommunity Hero
You can use low-level procedures: https://support.smartbear.com/viewarticle/75370/
- HKosovaSmartBear 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);- pyatakovOccasional 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);
- HKosovaSmartBear 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.
Related Content
- 2 years ago
- 3 years ago