Sign in to follow this  
Followers 0
MerkurAlex

control id class instance text

8 posts in this topic

#1 ·  Posted (edited)

is there a way WITHOUT using autoit window info program that i can get the control id class instance and text under the mouse position through an autoit program maybe using a dll?

Edited by EagleClaw

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites



is there a way WITHOUT using autoit window info program that i can get the control id class instance and text under the mouse position through an autoit program maybe using a dll?

MouseGetPos

WindowsFromPoint

ControlGetHandle

GetClass

?


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.

Share this post


Link to post
Share on other sites

MouseGetPos

WindowsFromPoint

ControlGetHandle

GetClass

?

not exactly but i figured out how im going to do it on my own thanks anyway

oh and perhaps you know how to delete a line from a file?


[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites

not exactly but i figured out how im going to do it on my own thanks anyway

oh and perhaps you know how to delete a line from a file?

RTFM comes to mind... maybe read it under File funcs.

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.

Share this post


Link to post
Share on other sites

I am also trying to figure out howto get the "Class" and "Instance" of a control. I need to basicly get the same results as ControlGetFocus Returns.

Edit2

MouseGetPos

WindowsFromPoint

ControlGetHandle

GetClass

?

GUICtrlGetHandle returns the HWND of a control not Class or Instance. MouseGetPos only returns CoOrds. I am unfamiliar with GetClass or WindowsFromPoint, can you give the exact command name?

Does anyone know how the "AutoIt Windows Info" tool gets this info ?


There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Share this post


Link to post
Share on other sites

I am also trying to figure out howto get the "Class" and "Instance" of a control. I need to basicly get the same results as ControlGetFocus Returns.

GUICtrlGetHandle returns the HWND of a control not Class or Instance. MouseGetPos only returns CoOrds. I am unfamiliar with GetClass or WindowsFromPoint, can you give the exact command name?

Does anyone know how the "AutoIt Windows Info" tool gets this info ?

I know what they return... they were things to look at... in order to get the end result the OP posted about.

Windows*/GetClass are API calls.

A search in the Advanced search area, looking up WindowFromPoint in the example forum will actually yield pretty much what your looking for.


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.

Share this post


Link to post
Share on other sites

Thanks for the Help Smoke, the thread http://www.autoitscript.com/forum/index.ph...mp;#entry205832 you refered to definitly is getting the info i need,But I think im going about things the hard way.

I want to declare a button like

$Begin = GUICtrlCreateButton ("", 736, 224, 131, 25,$BS_BITMAP)

and then be able to detect if the button has focus or not, as far as I can tell the only way to do this is with ControlGetFocus. So I guess my question is how to do that? I have currently been trying to get the CLass and Instance useing nothing but the ControlID but this doesnt seem possible.


There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

ok well unless someone knows a better way im just useing Smoke_N's Script

HotKeySet('{END}', '_ExitNow') ;END Button

While 1
    ToolTip(_CtrlGetClassNN_ByPos())
    Sleep(20)
WEnd

Func _CtrlGetClassNN_ByPos()
    Local $hWin = WinGetHandle(''), $sCreateArray = '', $sClassList = WinGetClassList($hWin)
    Local $sSplitClass = StringSplit(StringTrimRight($sClassList, 1), @LF), $sReturn = ''
   
    $OptMCM = Opt('MouseCoordMode', 2)
    Local $aMPos = MouseGetPos()
    Opt('MouseCoordMode', $OptMCM)
   
    For $iCount = UBound($sSplitClass) - 1 To 1 Step - 1
        Local $nCount = 0
        While 1
            $nCount += 1
            Local $aCPos = ControlGetPos($hWin, '', $sSplitClass[$iCount] & $nCount)
            If @error Then ExitLoop
            If $aMPos[0] >= $aCPos[0] And $aMPos[0] <= ($aCPos[0] + $aCPos[2]) _
                And $aMPos[1] >= $aCPos[1] And $aMPos[1] <= ($aCPos[1] + $aCPos[3]) Then
                If $sSplitClass[$iCount] <> '' Then Return $sSplitClass[$iCount] & $nCount
            EndIf         
        WEnd
    Next
    Return $sReturn
EndFunc

Func _ExitNow()
    Exit 0
EndFunc

Instead of feeding it mouse positions I use ControlGetPos to feed it the CoOrds of a Contrl. This way I can tell what control has Focus based just on a ControlID

Edited by ofLight

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

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