Sign in to follow this  
Followers 0
tmakruck

Controlundermouse

8 posts in this topic

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

Share this post


Link to post
Share on other sites



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

use the autoit window info tool in the autoit program group on your start menu

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

use the autoit window info tool in the autoit program group on your start menu

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...

Share this post


Link to post
Share on other sites

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?

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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
i 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

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Here is the link that I think cameronsdad is talking about: http://www.autoitscript.com/forum/index.ph...indpost&p=93536


[center]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.[/center]

Share this post


Link to post
Share on other sites

Here is the link that I think cameronsdad is talking about: http://www.autoitscript.com/forum/index.ph...indpost&p=93536

precisely. good job man. i guess i wasn't too far off with the 8 month guess

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0