need a little help with SetControlText
Moderators: JRL, Dorian (MJT support)
need a little help with SetControlText
I am continuing to attempt to get it right, but if anyone can clarify the proper syntax sooner, please do!
here is one of the controls for which I want to set the text as copied from View System Windows.
2229084 - Centura:Ch:Column "Cost Code"
obviously,, I want to fit the right bits into:
SetControlText>Window Title,ClassName,Instance,NewText
Thank you.
here is one of the controls for which I want to set the text as copied from View System Windows.
2229084 - Centura:Ch:Column "Cost Code"
obviously,, I want to fit the right bits into:
SetControlText>Window Title,ClassName,Instance,NewText
Thank you.
wrong info?
I believe gave the information for the column heading instead of the edit box for the heading.
it appears the edit boxes for several headings are located in a Centura:ChildTable""
I cannot rely on the column's location, width, etc to be constant. I think SetControlText is my only hope (short of buying a bit of VBScript, if that would work)
it appears the edit boxes for several headings are located in a Centura:ChildTable""
I cannot rely on the column's location, width, etc to be constant. I think SetControlText is my only hope (short of buying a bit of VBScript, if that would work)
Classname is "Centura:Ch:Column" (without quotes).
WindowName I don't know - you should know this from the title of the window. Instance - depends on how many there are and this one's sequence. May need trial and error.
WindowName I don't know - you should know this from the title of the window. Instance - depends on how many there are and this one's sequence. May need trial and error.
MJT Net Support
[email protected]
[email protected]
instances
how am I to be sure that a numeric constant like 'instance' will be the same each time? is this something for which I should create a variable to programmatically populate? Is it reliable to use the same instance number for that object each time?
I'll test, but would like your opinion
I'll test, but would like your opinion
It depends. It may not be reliable. Depends on the application in question. Take toolbars for example. They can be moved around by the user and the user can decide which ones show and where they are. They may therefore be created in a different sequence each time and so the instance number is unreliable. Instance 2 may be a different toolbar the next time the app is open and probably different on a different machine.
Static controls will be more reliable. Buttons and text fields for example will be created in pretty much the same order each time.
Static controls will be more reliable. Buttons and text fields for example will be created in pretty much the same order each time.
MJT Net Support
[email protected]
[email protected]
instances
Thank you. Then on a window where users are allowed to change the order of columns, instance would definitely be unreliable. Any chance of having a VB guru solve this? maybe read the system windows, find the first occurence of these edit boxes AFTER the occurrence of the parent window, then return the instance correctly to MacroScheduler? This has to do with entering Cost data for a prospect, so quite critical. If I am successful, they will be required to purchase several copies of MS to run these processes.
thank you, again.
thank you, again.
Hi,
I doubt VB would be capable of doing that. But some Win32 API might help. Would need a copy of the application you are automating to be able to offer any real help. Which application is it?
Can you not just enter the data via keyboard simulation (SetFocus, Press Tab ... Send>whatever ...)?
I doubt VB would be capable of doing that. But some Win32 API might help. Would need a copy of the application you are automating to be able to offer any real help. Which application is it?
Can you not just enter the data via keyboard simulation (SetFocus, Press Tab ... Send>whatever ...)?
MJT Net Support
[email protected]
[email protected]
via keyboard
keyboard is what I am currently doing, but I've learned that if a user re-orders the columns, my keystrokes will hit he wrong columns. So I wanted to try SetControlText, which I am glad has happened because I now love that command and will use it extensively where it applies.
My next route will be to do what I have named 'fingerprinting'....I'll get a scatter-shot of pixels from the column heading to determine what the heading must be, then click below that (by some number of pixels) and send>whatever.....by fingerprinting I mean check 10 pixels on each heading which will be certain to lead to a fail-proof identification. I've used it on other apps with perfect results. Sort of a subset of GetRectCheckSum.....and a bit faster.
btw, great product, run and rewarding to work with....I have an idea for another 'add-on'.....I'll keep you informed....
Skunk.
My next route will be to do what I have named 'fingerprinting'....I'll get a scatter-shot of pixels from the column heading to determine what the heading must be, then click below that (by some number of pixels) and send>whatever.....by fingerprinting I mean check 10 pixels on each heading which will be certain to lead to a fail-proof identification. I've used it on other apps with perfect results. Sort of a subset of GetRectCheckSum.....and a bit faster.
btw, great product, run and rewarding to work with....I have an idea for another 'add-on'.....I'll keep you informed....
Skunk.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Since a user can reposition the columns, etc. that means that you can do that also.
Can't you make a macro to change the existing format into the format you want for your process. Then close the original document withoug saving and the user's specs would be retained?
I have done things like that in Excel, using some conditional if statements and column positions and column titles. Make the Excel formating macros, and then have Macro Scheduler call them.
I know this is not Excel, but thought the concept might be transferable.
Can't you make a macro to change the existing format into the format you want for your process. Then close the original document withoug saving and the user's specs would be retained?
I have done things like that in Excel, using some conditional if statements and column positions and column titles. Make the Excel formating macros, and then have Macro Scheduler call them.
I know this is not Excel, but thought the concept might be transferable.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!