Alex1986 Posted March 31, 2016 Share Posted March 31, 2016 Hi I need to Begins get mouse Pos From inside the rectangle , i use GUIGetCursorInfo() . Example : expandcollapse popup#include <GDIplus.au3> #include <GUIConstantsEx.au3> AutoItSetOption("MouseCoordMode", 0) AutoItSetOption("GUIOnEventMode", 1) Global Const $iW = 400, $iH = 400, $iBgColor = 0xF0F0F0 Global Const $hGUI = GUICreate("", $iW, $iH) GUISetBkColor($iBgColor, $hGUI) GUISetState() _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hPen = _GDIPlus_PenCreate() $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 4) _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, 4) Global Const $iPosX = 50, $iPosY = 50, $iWidth = 300, $iHeight = 300 GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") Do $hPos = GUIGetCursorInfo($hGUI) ToolTip($hPos[0] & " , " & $hPos[1]) _GDIPlus_GraphicsClear($hCtxt, 0xFF000000 + $iBgColor) _GDIPlus_GraphicsDrawRect($hCtxt, $iPosX, $iPosY, $iWidth, $iHeight, $hPen) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iW, $iH) Until Not Sleep(10) Func _Exit() _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_PenDispose($hPen) _GDIPlus_Shutdown() GUIDelete() Exit EndFunc Link to comment Share on other sites More sharing options...
JohnOne Posted March 31, 2016 Share Posted March 31, 2016 ToolTip($hPos[0] - $iPosX & " , " & $hPos[1] - $iPosY) Alex1986 and UIL 2 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now