tmakruck Posted March 27, 2006 Share Posted March 27, 2006 Is there a way to get the controlID or ClassNameNN of the control that is currently under the mouse pointer? I couldnt figure out how to do it.... This would have to be done without knowing the name of the active window. Maybe do something like this: Func _GetControlUnderMouse () $arrMousePos = MouseGetPos () ; use the $arrMousePos to get the Control Under Mouse ; kinda like how au3Info.exe does it Return $strControlName EndFunc;_GetControlUnderMouse () I couldn't figure out how to do this... Thanks, Todd Link to comment Share on other sites More sharing options...
seandisanti Posted March 27, 2006 Share Posted March 27, 2006 Is there a way to get the controlID or ClassNameNN of the control that is currently under the mouse pointer? I couldnt figure out how to do it.... This would have to be done without knowing the name of the active window. Maybe do something like this: Func _GetControlUnderMouse () $arrMousePos = MouseGetPos () ; use the $arrMousePos to get the Control Under Mouse ; kinda like how au3Info.exe does it Return $strControlName EndFunc;_GetControlUnderMouse () I couldn't figure out how to do this... Thanks, Todduse the autoit window info tool in the autoit program group on your start menu Link to comment Share on other sites More sharing options...
tmakruck Posted March 27, 2006 Author Share Posted March 27, 2006 use the autoit window info tool in the autoit program group on your start menuI actually want to do this from inside the script itself... I know that the window spy exists, but I dont want that running while my script is running... Link to comment Share on other sites More sharing options...
seandisanti Posted March 27, 2006 Share Posted March 27, 2006 I actually want to do this from inside the script itself... I know that the window spy exists, but I dont want that running while my script is running...and you can't use the text in the control? Link to comment Share on other sites More sharing options...
tmakruck Posted March 27, 2006 Author Share Posted March 27, 2006 and you can't use the text in the control? No I Cant. Basically what I'm trying to do is "Count" how many icons are in the Windows Task Tray. I want to look at each one, and make sure certain ones are displayed. Unfortunately,my task tray is located in the bottom right of my screen, yet it's position is X: 1369 Y: 1.(Variable based on what apps are running, minimized, etc) Since my screen res is 1680x1050, I would expect the position to be close to X: 1369 Y: 1000, since the task tray is only one line tall. So, I'm processing the icons from right to left ( Start at the clock, and move towards the Start Button) but once i'm outside the bounds of the task tray, quit looking. So what I want to do is say Func FindTrayIcon ( $WinTitle ) $xpos = @DesktopWidth - 103 $yPos = @DesktopHeight - 15 ControlGetPos ( "", "", "ToolbarWindow321" ) msgBox ( 0 , "" , "X = " & $xpos & @CR & "Y = " & $ypos ) $Found = 0 While NOT $Found MouseClick ( "secondary" , $xpos, $ypos ) Wait ( 1 ) If WinActive ( $WinTitle , "" ) Then $Found = 1 $strCoordinates = $xpos & "," & $ypos MsgBox ( 0 , "Information" , "Found """ & $WinTitle & """ Icon at " & $strCoordinates ) EndIf $xpos = $xpos - 18 Send ( "{ESC}" ) ; If we've reached the end of the tasktray, exit the loop Wend Send ( "{ESC}" ) Return $strCoordinates EndFunc Link to comment Share on other sites More sharing options...
seandisanti Posted March 27, 2006 Share Posted March 27, 2006 No I Cant. Basically what I'm trying to do is "Count" how many icons are in the Windows Task Tray. I want to look at each one, and make sure certain ones are displayed. Unfortunately,my task tray is located in the bottom right of my screen, yet it's position is X: 1369 Y: 1.(Variable based on what apps are running, minimized, etc) Since my screen res is 1680x1050, I would expect the position to be close to X: 1369 Y: 1000, since the task tray is only one line tall. So, I'm processing the icons from right to left ( Start at the clock, and move towards the Start Button) but once i'm outside the bounds of the task tray, quit looking. So what I want to do is say Func FindTrayIcon ( $WinTitle ) $xpos = @DesktopWidth - 103 $yPos = @DesktopHeight - 15 ControlGetPos ( "", "", "ToolbarWindow321" ) msgBox ( 0 , "" , "X = " & $xpos & @CR & "Y = " & $ypos ) $Found = 0 While NOT $Found MouseClick ( "secondary" , $xpos, $ypos ) Wait ( 1 ) If WinActive ( $WinTitle , "" ) Then $Found = 1 $strCoordinates = $xpos & "," & $ypos MsgBox ( 0 , "Information" , "Found """ & $WinTitle & """ Icon at " & $strCoordinates ) EndIf $xpos = $xpos - 18 Send ( "{ESC}" ) ; If we've reached the end of the tasktray, exit the loop Wend Send ( "{ESC}" ) Return $strCoordinates EndFunci am pretty sure there is already a script to do something to this effect. i want to say about 8 months ago there was a script to identify the icons in the systray; it was made because of someone wanting to know when a specific icon disappeared. search for systray or tray icons in this forum and in scripts and scraps Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 27, 2006 Moderators Share Posted March 27, 2006 Here is the link that I think cameronsdad is talking about: http://www.autoitscript.com/forum/index.ph...indpost&p=93536 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
seandisanti Posted March 27, 2006 Share Posted March 27, 2006 Here is the link that I think cameronsdad is talking about: http://www.autoitscript.com/forum/index.ph...indpost&p=93536precisely. good job man. i guess i wasn't too far off with the 8 month guess 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