Forum Discussion

sastowe's avatar
Super Contributor
14 years ago

third party controls

I am reading the <a href="">Addressing Toolbar Buttons" topic in help. It is not helping. I believe because the program I am testing uses a third party ActiveX Control called CodeJock Toolbars.

In screwing around with this, I made the following sub

Sub ClickStatusToolbarFilterButton

  set o = Sys.Process("Instrument Manager").VBObject("imMainForm").Window("MDIClient", "", 1).VBObject("frmStatus", 5000)

  if o.Exists Then

    set t = o.Window("XTPDockBar", "xtpBarTop", 1).Window("XTPToolBar", "Default Toolbar", 1)


    for i = 0 to t.wButtonCount - 1




  end if


See the commented out ClickItem. I tried to click by caption and by index. Neither worked. So I tried to loop through to see what I could see. t.wButtonCount is reporting 0 buttons.

Does anyone have advice about how to determine how to get to these buttons for this third party control?




End Sub 

6 Replies

  • Hi Stephanie,

    There is no special support for this control in TestComplete. However, our customers succeed in working with the XTPToolBar control via MSAA. I recommend that you add the following class names to the list of accepted MSAA windows:



    Please refer to the Using Microsoft Active Accessibility help topic for more information.

    If you still fail to find a reliable way to work with the control, please send us a sample application demonstrating the control. We'll try to create a sample script for you.

    BTW, you can vote for the control here.
  • sastowe's avatar
    Super Contributor
    Thanks! Have people used this technique successfully with ComponentOne's grid as well, do you know?

    Thanks a bunch for the reference. I believe that this is exactly what I need.
  • sastowe's avatar
    Super Contributor
    Is there a list of class names of controls that people have used successfully somewhere?

    This totally makes my life SO much easier knowing this. Thanks.
  • Hi Stephanie,

    You can compile your application as open with debug information (see the Debug Info Agent help topic) and work with the C1Grid control via its native properties and methods. 

    The following sample script demonstrates how to click a cell in C1Grid:

    Sub Main

      'The script works with the ColumnEditor sample application("<ComponentOne Studio.NET 2.0>\C1FlexGrid\Samples\CS\ColumnEditor\bin\Debug\ColumnEditor.exe")

      Dim pSample, wMain, wGrid

      Set pSample = Sys.Process("ColumnEditor")

      Set wMain = pSample.WinFormsObject("Form1")


      Set wGrid = wMain.WinFormsObject("_myControl").WinFormsObject("_flex")

      RowId = 1

      ColId = 1

      If ClickCell(wGrid, RowId, ColId) Then

        Log.Message "The [" & RowId & ", " & ColId & "] cell was successfully clicked."


        Log.Error "The [" & RowId & ", " & ColId & "] cell was not found."

      End If  

    End Sub

    You can try using MSAA approach too, as well as other approaches described in the Ways to Interact With Application Objects help topic. As for class names, you can add the "*" window class to the list of accepted windows to verify whether it makes recognition better.
  • sastowe's avatar
    Super Contributor
    We are not working with .NET. This is VB6 and what was formerly Apex TrueDBGrid.
  • Hi Stephanie,

    General solutions for customized third-party controls can be found in the Ways to Interact With Application Objects help topic I mentioned in my previous post. And you still can compile your application as open with debug information and work with the control via its native properties and methods. If you want us to create a script example for you, please send us  a sample application containing the target control.