Amen Posted February 15, 2006 Posted February 15, 2006 (edited) From Autoit Help file: "GUIGetCursorInfo ( [winhandle] ) .. $array[4] = ID of the control that the cursor is hovering over (or 0 if none) .. The mouse cursor position is successfull only on an active window created by a GUICreate." Autoit info tool can retrive any control ID of Control Under Mouse.. >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 0 Y: 90 W: 760 H: 362 Control ID: 11 ClassNameNN: SysListView321 Text: Style: 0x54A00249 ExStyle: 0x00000200 My prog cannot.Can anyone helps me? To do the same thing without Using the Autoit Info tool? (retrieve the ControlID of the control Under Mouse) Edited February 15, 2006 by Amen Plugged ThoughtsQBsick? check my Old staff (New Launchers to Work with Windows.Thnx to Autoit!)Game Development ToolsPortes (A Backgammon game)Ball (An Arkanoid Style game)Au3? SecretProgz - Reveals Commands that can be used on your system CleanOut - Uninstall leftovers Enable windows XP Autologon. Stop Windows Auto Sharing your hard drives (C$,D$,etc) D-Link - Create a dynamic link.Useful for server shortcuts Fun - How would your name sounds in Japanese,Russian or Reventian? Fix_srt - Shift a subtitle (.srt) some secs +/-
rysiora Posted March 14, 2006 Posted March 14, 2006 I really wanted to know it too. I think it's something with the WinAPI functions: GetCursorPos WindowFromPoint ChildWindowFromPoint While 1 $p = DllStructCreate("int;int") $pet = DllCall("user32.dll", "int", "GetCursorPos", "ptr", DllStructGetPtr($p)) $set = DllCall("user32.dll", "int", "WindowFromPoint", "int", DllStructGetData($p,1),"int",DllStructGetData($p,1)) ;$set = DllCall("user32.dll", "int", "ChildWindowFromPoint", "hwnd", $WinNow, "int", DllStructGetData($p,1),"int",DllStructGetData($p,1)) TrayTip("", $set[0], 5, 16) Sleep(1) WEnd Hope you will find it out
litlmike Posted March 15, 2006 Posted March 15, 2006 From Autoit Help file: "GUIGetCursorInfo ( [winhandle] ) .. $array[4] = ID of the control that the cursor is hovering over (or 0 if none) .. The mouse cursor position is successfull only on an active window created by a GUICreate." Autoit info tool can retrive any control ID of Control Under Mouse.. >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 0 Y: 90 W: 760 H: 362 Control ID: 11 ClassNameNN: SysListView321 Text: Style: 0x54A00249 ExStyle: 0x00000200 My prog cannot.Can anyone helps me? To do the same thing without Using the Autoit Info tool? (retrieve the ControlID of the control Under Mouse) Truthfully, I don't know what you are asking, but maybe this will help. FindClasses by Text _ArrayPermute()_ArrayUnique()Excel.au3 UDF
rysiora Posted March 15, 2006 Posted March 15, 2006 (edited) expandcollapse popup$prevhwnd = 0 $hwnd = WindowFromPoint() While 1 If $prevhwnd <> $hwnd And $hwnd <> 0 Then $WinNow = WinGetHandle(WinGetTitle("")) DllCall("user32.dll","int","InvalidateRect","hwnd",$WinNow,"int",0,"int",1) OutlineControl($hwnd,$WinNow) $prevhwnd = $hwnd EndIf Sleep(1) $hwnd = WindowFromPoint() WEnd Func WindowFromPoint() $p = DllStructCreate("int;int") DllCall("user32.dll", "int", "GetCursorPos", "ptr", DllStructGetPtr($p)) Local $point1 = DllStructGetData($p,1), $point2 = DllStructGetData($p,2) $hwnd = DLLCall("user32.dll", "hwnd", "WindowFromPoint", "int", $point1, "int", $point2) If $hwnd[0] <> 0 Then $pos = WinGetPos($hwnd[0]) If @error Then Return 0 $size = WinGetClientSize($hwnd[0]) If @error Then Return 0 $pos[0] += (($pos[2] - $size[0]) / 2) $pos[1] += (($pos[3] - $size[1]) - (($pos[2] - $size[0]) / 2)) $cHwnd = DLLCall("user32.dll","hwnd","ChildWindowFromPoint","hwnd",$hwnd[0], _ "int",$point1 - $pos[0],"int",$point2 - $pos[1]) If $cHwnd[0] <> 0 Then $hwnd[0] = $cHwnd[0] EndIf Return $hwnd[0] EndFunc Func OutlineControl($l_hWnd,$l_hWndDad) $l_rect = ControlGetPos("","",$l_hWnd) $l_hdc = DLLCall("user32.dll","int","GetDC","hwnd",$l_hWndDad) DLLCall("gdi32.dll","int","MoveToEx","int",$l_hdc[0],"int",$l_rect[0],"int",$l_rect[1],"int",0) DLLCall("gdi32.dll","int","LineTo","int",$l_hdc[0],"int",$l_rect[0] + $l_rect[2],"int",$l_rect[1]) DLLCall("gdi32.dll","int","LineTo","int",$l_hdc[0],"int",$l_rect[0] + $l_rect[2],"int",$l_rect[1]+$l_rect[3]) DLLCall("gdi32.dll","int","LineTo","int",$l_hdc[0],"int",$l_rect[0],"int",$l_rect[1]+$l_rect[3]) DLLCall("gdi32.dll","int","LineTo","int",$l_hdc[0],"int",$l_rect[0],"int",$l_rect[1]) $l_hdc = DLLCall("user32.dll","int","ReleaseDC","hwnd",$l_hWndDad,"int",$l_hdc[0]) EndFunc It works now quite nice, only sometimes highlights strange things... Edited March 15, 2006 by rysiora
DeltaRocked Posted January 27, 2011 Posted January 27, 2011 Hi , am unable to understand this as what would be the output... its supposed to provide the position of caret right?
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