本文整理汇总了Java中com.sun.jna.platform.win32.WinDef.POINT属性的典型用法代码示例。如果您正苦于以下问题:Java WinDef.POINT属性的具体用法?Java WinDef.POINT怎么用?Java WinDef.POINT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.jna.platform.win32.WinDef
的用法示例。
在下文中一共展示了WinDef.POINT属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
public void run() {
UIAutomation automation = UIAutomation.getInstance();
do {
this.rest();
Point p = MouseInfo.getPointerInfo().getLocation();
logger.info(p.getX() + " - " + p.getY());
WinDef.POINT point = new WinDef.POINT();
point.x = (int) p.getX();
point.y = (int) p.getY();
try {
AutomationElement elementUnder = automation.getElementFromPoint(point);
logger.info("From point = " + elementUnder.getName());
AutomationElement elementFocus = automation.getFocusedElement();
logger.info("From focus = " + elementFocus.getName());
} catch (Exception ex) {
logger.info(ex.getStackTrace());
}
} while (true);
}
示例2: getClickablePoint
/**
* Gets the clickable point for the control.
*
* @return The clickable point.
* @throws AutomationException Call to Automation API failed.
*/
public WinDef.POINT getClickablePoint() throws AutomationException {
WinDef.POINT.ByReference pbr = new WinDef.POINT.ByReference();
WinDef.BOOLByReference br = new WinDef.BOOLByReference();
final int res = this.element.getClickablePoint(pbr, br);
if (res != 0) {
throw new AutomationException(res);
}
return new WinDef.POINT(pbr.x, pbr.y);
}
示例3: testGetClickablePointForDesktop
@Test
public void testGetClickablePointForDesktop() throws AutomationException {
AutomationElement root = instance.getRootElement();
WinDef.POINT empty = new WinDef.POINT(0, 0);
assertTrue("root:" + root.getClickablePoint(), root.getClickablePoint().dataEquals(empty));
}
示例4: getCoord
public List<Integer> getCoord()
{
if(!available || libuser32 == null)
return null;
WinDef.POINT point = new WinDef.POINT(0,0);
if(libuser32.ClientToScreen(libuser32.FindWindowW(null, name.toCharArray()), point))
{
List<Integer> coord = new ArrayList<>();
coord.add(point.x);
coord.add(point.y);
return coord;
}
else
return null;
}
示例5: click
/**
* <p>
* Invokes the click event for this control.
* </p>
* <p>
* Actually manufactures the click, as the toolbar buttons do
* not seem behave properly
* </p>
* @throws AutomationException Automation library error.
*/
public void click() throws AutomationException {
WinDef.POINT point = this.element.getClickablePoint();
AutomationMouse mouse = AutomationMouse.getInstance();
mouse.setLocation(point.x, point.y);
mouse.leftClick();
}
示例6: testGetClickablePoint_Throws_Exception_When_Automation_Returns_False
@Test(expected = AutomationException.class)
public void testGetClickablePoint_Throws_Exception_When_Automation_Returns_False() throws AutomationException {
IUIAutomationElement mocked = Mockito.mock(IUIAutomationElement.class);
when(mocked.getClickablePoint(isA(WinDef.POINT.ByReference.class), isA(WinDef.BOOLByReference.class)))
.thenReturn(-1);
WinDef.POINT point = new WinDef.POINT();
AutomationElement element = new AutomationElement(mocked);
element.getClickablePoint();
}
示例7: getClickablePoint
/**
* Gets a clickable point for the control.
*
* This is manufactured by getting the bounding rect and finding the middle point.
*
* @return The clickable point.
* @throws AutomationException Error in automation library.
*/
public WinDef.POINT getClickablePoint() throws AutomationException {
return this.element.getClickablePoint();
}
示例8: setLocation
/**
* Moves the mouse pointer to a given screen point.
*
* @param point The point to move to.
*/
public void setLocation(final WinDef.POINT point) {
robot.mouseMove(point.x, point.y);
}
示例9: elementFromPoint
int elementFromPoint(WinDef.POINT pt, PointerByReference element);
示例10: ClientToScreen
boolean ClientToScreen(Pointer hWnd, WinDef.POINT point);
示例11: ClientToScreen
public WinDef.BOOL ClientToScreen(WinDef.HWND hWnd, WinDef.POINT lpPoint);