Jump to content

Acquiring Variable Instance id


Recommended Posts

Dear Members..

Does anybody have a solution for my challenge 

since im working on something and it's presenting a challenge i cant handle 

The program im making the automation for has the following problem, once i change it's subscription the instance ID of the button i need to press changes. 

Does there exits a way for me to like  at first run of my tool it asks to press the correct button  then it record's/ stored the instance in a variable for me to work with at a later time 

I know hat this will present the problem since recording / Keylogging is not allowed 

albeit that im not constantly using it it's just for initial identification purposes  ( much like the window Info "Finder tool" works for me but not for the other users).

Pleas help i cause i know theyre should be a solution out there

Link to comment
Share on other sites

If the control ID changes, I don't think recording the control ID from a click(if that's even possible), will help you any.

Does it only change the once?

You could save the mouse coordinates I suppose.

Edited by blckpythn
Link to comment
Share on other sites

ill show you some  screenshot from diffrent users targetting the same controll 

vn4c.png

finderinfo9mz31.jpg

d9sr7r84l3b.jpg

 

this is why im presented with this problem   it's a program that aquire's it's subscription list online  so it's diffrent from user to user   but always the same for a specified user.

I know the position seems the same but once to scroll down it wont be ....  rather challenging    ( working fine if i give everybody a personal version but just want to automate this )  

 

before you start saying use the name of teh control   here is the list of all the controll names 

 

toolStrip3
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
toolStrip1
 
 
guess what it is one of the toolStrip1  :P  
Edited by KiLLer001
Link to comment
Share on other sites

I think I seen a tool in example forums not to long ago which helped in properly and uniquely identifying .Net forms.

Worth having a look.

And by the way if you are trying to identify a control in window info tool, it's wise to look at control tab rather than window tab.

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

controll tab show's no extra info  atleast no usefull one 

qqx3.png

ID changes every reload of the program, Position as said changes cause if scrolling,  Size changes cause of window size,  Controll click coords change cause of  Window size and scrolling, Handle changes after every load 

really the only thing i can use is the instance    ( the only that doesnt change on every load but is just diffrent from user to user )

Edited by KiLLer001
Link to comment
Share on other sites

I think I seen a tool in example forums not to long ago which helped in properly and uniquely identifying .Net forms.

Worth having a look.

And by the way if you are trying to identify a control in window info tool, it's wise to look at control tab rather than window tab.

 

just found the .net indentify thing see if that works for me 

gives alot of error's while used as the udf states  gues nosolution there   ...   is there really no way of a one time identification of the instance ??

maybe i could include the window info tool let it get the instance store it then close it    well time to use the window info tool on the window info tool i guess

just seems kinda ridiculous is theyre really no other easier way ??

Edited by KiLLer001
Link to comment
Share on other sites

Is there any text that is unique to the window that can be  used with the class to identify the  window?

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

just found the .net indentify thing see if that works for me 

gives alot of error's while used as the udf states  gues nosolution there   ...   is there really no way of a one time identification of the instance ??

maybe i could include the window info tool let it get the instance store it then close it    well time to use the window info tool on the window info tool i guess

just seems kinda ridiculous is theyre really no other easier way ??

Someone has made a window info in autoit, you could probably study that to find out exactly how to do what you want.

EDIT: Yashied >here

Edited by JohnOne

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

If this is with one of your own programs created with AutoIt, then the ID's are numbered sequentially as they are created, so you should be able to use some calculation (assign variables, etc).

Please note though, that I haven't got a firm grasp on what you are doing.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

See if this will work on your LiLLerBoy_001 or KalyanPU window.

Press left mouse button on the control for that control's information.

Press Esc key to exit.

#include <WinApi.au3>
#include <Misc.au3>

Local $CtrlClassNN, $CtrlClass, $tPoint, $hWnd, $hCtrlHndl

While 1
    If _IsPressed('01') Then
        While _IsPressed('01') ; Left mouse down
            Sleep(10)
        WEnd
        $CtrlClassNN = ControlGetFocus("")
        $tPoint = _WinAPI_GetMousePos()
        $hWnd = _WinAPI_GetAncestor(_WinAPI_WindowFromPoint($tPoint), 2); 2 = $GA_ROOT
        $hCtrlHndl = ControlGetHandle($hWnd, "", $CtrlClassNN)
        $CtrlClass = _WinAPI_GetClassName($hCtrlHndl)
        MsgBox(0, "ControlGetFocus Example", "Ctrl Text: " & @TAB & ControlGetText($hWnd, "", $CtrlClassNN) & @LF & _
                "Ctrl Hndl: " & @TAB & $hCtrlHndl & @LF & _
                "Class: " & @TAB & $CtrlClass & @LF & _
                "ClassNN: " & @TAB & $CtrlClassNN & @LF & _
                "Instance: " & @TAB & StringTrimLeft($CtrlClassNN, StringLen($CtrlClass)))
    ElseIf _IsPressed('1B') Then ; Press Esc key to exit
        ExitLoop
    EndIf
    Sleep(20)
WEnd
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...