private Point clientToScreen(final Point clientPoint) { final POINT point = new POINT(clientPoint.x(), clientPoint.y()); User32.INSTANCE.ClientToScreen(handler, point); return new Point(point.x, point.y); }
public void getPosition(POINT outPosition) { User32Ext.INSTANCE.GetWindowRect(_hwnd, tmpRect); outPosition.x = tmpRect.left; outPosition.y = tmpRect.top; }
public void getSize(POINT outSize) { User32Ext.INSTANCE.GetWindowRect(_hwnd, tmpRect); outSize.x = tmpRect.right - tmpRect.left; outSize.y = tmpRect.bottom - tmpRect.top; }
/** * Searches a rectangle of pixels for the pixel color provided. * * @param left * left coordinate of rectangle. * @param top * top coordinate of rectangle. * @param right * right coordinate of rectangle. * @param bottom * bottom coordinate of rectangle. * @param color * Colour value of pixel to find (in decimal or hex). * @param shadeVariation * A number between 0 and 255 to indicate the allowed number of * shades of variation of the red, green, and blue components of * the colour. Default is 0 (exact match). * @param step * Instead of searching each pixel use a value larger than 1 to * skip pixels (for speed). E.g. A value of 2 will only check * every other pixel. Default is 1. * @return Return a 2 element array containing the pixel's coordinates if * success, return null if color is not found. */ public static int[] search(final int left, final int top, final int right, final int bottom, final int color, Integer shadeVariation, Integer step) { final POINT point = new POINT(); if ((shadeVariation == null) || (shadeVariation < 0) || (shadeVariation > 255)) { shadeVariation = 0; } if ((step == null) || (step <= 0)) { step = DEFAULT_STEP; } RECT rect = new RECT(); rect.left = left; rect.top = top; rect.right = right; rect.bottom = bottom; autoItX.AU3_PixelSearch(rect, color, shadeVariation, step, point); return hasError() ? null : new int[] { point.x, point.y }; }
/** * Retrieves the current position of the mouse cursor. * * See MouseCoordMode for relative/absolute position settings. If relative * positioning, numbers may be negative. * * @return Returns the current position of the mouse cursor. */ public static int[] getPos() { POINT point = new POINT(); autoItX.AU3_MouseGetPos(point); return new int[] { point.x, point.y }; }
/** * Retrieves the current X position of the mouse cursor. * * See MouseCoordMode for relative/absolute position settings. If * relative positioning, numbers may be negative. * * @param point */ public void AU3_MouseGetPos(POINT point);
/** * Searches a rectangle of pixels for the pixel color provided. * * @param rect * position and size of rectangle. * @param color * Colour value of pixel to find (in decimal or hex). * @param shadeVariation * A number between 0 and 255 to indicate the allowed number * of shades of variation of the red, green, and blue * components of the colour. Default is 0 (exact match). * @param step * Instead of searching each pixel use a value larger than 1 * to skip pixels (for speed). E.g. A value of 2 will only * check every other pixel. Default is 1. * @param point * Return the pixel's coordinates if success, sets * oAutoIt.error to 1 if color is not found. */ public void AU3_PixelSearch(RECT rect, int color, Integer shadeVariation, Integer step, POINT point);
/** * Returns the coordinates of the caret in the foreground window. * * WinGetCaretPos might not return accurate values for Multiple Document * Interface (MDI) applications if absolute CaretCoordMode is used. See * example for a workaround. Note: Some applications report static * coordinates regardless of caret position! * * @param lpPoint */ public void AU3_WinGetCaretPos(POINT lpPoint);
/** * Returns the coordinates of the caret in the foreground window. * * WinGetCaretPos might not return accurate values for Multiple Document * Interface (MDI) applications if absolute CaretCoordMode is used. See * example for a workaround. Note: Some applications report static * coordinates regardless of caret position! * * @return Returns the coordinate of the caret if success, return null if * failed. */ public static int[] getCaretPos() { POINT point = new POINT(); autoItX.AU3_WinGetCaretPos(point); return hasError() ? null : new int[] { point.x, point.y }; }