Sign in to follow this  
Followers 0
ledigeine

Pull control names from VB6

1 post in this topic

#1 ·  Posted (edited)

Hello, recently I have started writing up automation scripts in visual studio. These scripts require me to know the (name) field in the properties of controls written in vb6.

  1. My idea here is to open up the screen in vb6, I won't have the code checked out so i wont have to worry about altering it.
  2. Some how cycle through the screen and record the (name) property for each control. The controls are named in a way that I should know if i need them or not. (ex. fraFrame1 wouldn't be needed because its a frame while txtTextbox1 will be needed for me to enter data into it)
  3. Once I have all the fields I will be testing, I would want autoit to use those (name)'s to put in as much of the script as possible on my Visual Studio test files.
  4. After the mindless part of the testfile is done then I can do the small specifics on my own.

So the main issue I have right now is just starting out, I can't think of a way to actually select the controls in vb6 and pull out what is marked in the (name) field. On top of that I have another idea but getting the name is priority 1.  If that was figured out I could maybe figure out how to also check for additional properties.

Any help on this would be great... i know it sounds more confusing than it actually is since I am not great at explaining things.

Edit: Might have found a way around checking the actual screen for controls then looking at the Properties section of the screen. It seems I could just open the .ctl file as a text file and run through the document looking for keywords.

Not 100% how that will work, I would probably want to search the whole document for any (name) properties starting with wte/txt/cbo/wde/mle then save those names into an array? So when I want to dump the data into a new document I could just do a For Each for the items that make up the array.

Let me know if this sounds like something that might work.

Edited by ledigeine

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

  • Similar Content

    • Psyllex
      By Psyllex
      I have a super simple login screen I'm trying to access that is written in java.  My java testing tools can't access the login screen because it's a modal window.  So I figured I'd see if AutoIt can manipulate 'something' on it.  I can enter text within the text boxes for user name and password.  But I can't see to click on the login button.  I've tried just tabbing to it and hitting the enter key (as I really wouldn't have to be completely interacting with the frame).  But that didn't work.  I was hoping to throw it some coordinates and just double click in that relative area, but when I get the whole " ==> Subscript used on non-accessible variable.:" when I attempt to use ControlGetPos() I'm assuming because it can't truly interact with the Java frame.  So I'm kind of stuck here...can't use AutoIt, can't use a Java automation testing tool to do this due to the modal issues.  Does anyone have any ideas?  My code is below though I think it's less to do with code and more what AutoIt can and can't do.
      #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Local $hWnd = WinActivate("[CLASS:sunawtframe]", "Login") Local $aPos = ControlGetPos($hWnd, "[CLASS:SUNAWTFRAME]", "Login") Local $myXPos = $aPos[0] + 420 Local $myYPos = $aPos[1] + 270 Send("guest") Send("{TAB}") Send("guest") Send("{TAB}") ;Tried Control Click it failed ControlClick($hWnd, "", "Login") ;Tried Mouse Click and that failed MouseClick("Left", $myXPos, $myYPos, 2)  
      Thanks for any help!
    • Trolleule
      By Trolleule
      Hi all,
      i was currently working with html when i got myself the question if there is a windows control that acts like a html container e.g. a div with the hidden attribute. The benfeit is obvious. You can put code in this container and at the moment it is hidden it doesnt take room but when i got visible it uses the room it needs. Is there something i can use with windows forms?
      Normally one have to recalculate the position of all controls and adjust them manually.
    • kcvinu
      By kcvinu
      Hi all,
      This code is from an IronPython project. 
      self._button1.Click += self.Button1_Click self._button1.MouseHover += self.Button1_MouseHover def Button1_Click(self, sender, e): System.Windows.Forms.MessageBox.Show("Hi you clicked me ?") pass def Button1_MouseHover(self, sender, e): sender.Text = "Mouse Entered" pass How easy to connect any event function to any control. I know AutoIt can do this with GUICtrlSetOnEvent function.  But this function only takes control ID and function name as parameters. We can't tell AutoIt to act on which event. And for some events, we needs to use GUIRegisterMsg in order to respond some specific messages. My question is ---  Is it possible to do this IronPython way in AutoIt ?
    • DavidLago
      By DavidLago
      Hello. 
      Not sure this is the right forum. If I'm wrong, please, let me know.
      I have a task that I really don't know where to begin at. I have a legacy application built in VB6 (yeah, I know) and lately it has been reported to slow down some of the hours of the day and I'm supposed to have a end-user-experience log for this.
      I have worked with IE before, doing things like _IEFormGetCollection, then _IEFormElementGetCollection, and manipulating @extended tags, also, _IEFormElementGetObjByName, _IEFormElementSetValue and _IEFormSubmit at the end. Another example is _IEImgGetCollection, then working with the variable properties, like $xyz.src.
      What I need to do is basically the same.
      - Collecting GUIForms or elements and Setting values into forms (like _IEFormElementSetValue) 
      - Submitting the info to generate an order on another frame of the GUI, and measure the timing.
       
      What I need to know:
      What function or section to be based upon. I have searched in the help file for over a hour with no luck. I've found some stuff within _WinAPI, GDIPlus, and GUIReference, though I wasn't able to find a suitable function to work with this. I have also searched and read some topics in our forum, but most of them refers to AutoIt GUIs. If I missed something, please, educate me.
      Of course, I'll post whatever I can share about what could be helpful for other users.
    • kcvinu
      By kcvinu
      Hi all,
      I have a form with 15 textboxes. I need to set all of them disabled when i press a button. So i decided to use a loop. But how can i do it. Any idea ?