IMPORTANT NOTICE: As of 21 February, anything posted in this community WILL NOT BE MIGRATED to our new community site. We have pulled all user information and data from this site and are now in an approximately week long process of importing users, roles, and data to our new site. We are leaving this site open and active so you can post and hopefully get a response until the migration is complete. Once complete, the URL that currently takes you to this site will take you to our new site so your bookmarks will work as always. Please read the information on a New Login Process
One of the most frustrating parts of creating tests that rely on low-level events is getting the co-ordinate offsets of the objects you want to interact with. The attached small program - getMousePos - should ease this frustration considerably by getting the offsets for you. There are two caveats with this:
1. If you are trying to get co-ordinates against the desktop to action objects in the application then either the application must be full-screen or alternatively, it can be relied upon to always appear in the same place and at the same size.
2. If you are trying to get offsets from objects within the application then the application must always appear as the same size. Placement on screen does not matter in this case. This setup is illustrated below.Mouse Position uses the top left corner of the monitor as the absolute position to work from. If you want to get the rectangle co-ordinates of a object then proceed as follows:1. Identify the top left corner of the child container and select ctrl+tab to freeze the display
2. Select 'Copy To Offsets' to transfer the co-ordinates to the X and Y offset boxes. The X Pos and Y Pos boxes will now use these co-ordinates as the starting point3. Select 'Start Tracking' and move to the lower right corner of the object4. Select ctrl+tab to freeze the display again
5. The display will now give you the x and y offset and the size of the rectangle required for the SilkTest RECT parameter6. Select 'Show Rectangle' to get the absolute co-ordinate set.
Selecting 'Move to Pos' will move the mouse cursor to X Pos and Y Pos relative to any X Offset and Y Offset.
Required: dotNet Framework 4.0 or later.This utility is provided 'as-is' and is not supported by Micro Focus.