Jump to content

Custom Control roadblock...


Recommended Posts

I wrote the function long ago, let's see if I can remember what this output is:

Just looking at the above, I don't know any (off the top of my head) list views that have that ClassNameNN, are you even sure you have the right control?

Another suggestion may be so simple as to just set focus on the that particular control if you are sure that's the right control (I usually use ControlHide() when I play with the tough ones to test)

I would suggest using yet another one of my functions... http://www.autoitscript.com/forum/index.ph...c=32781&hl=

I would get all the controls on the GUI, then loop through them 1 at a time with my _list_view function, console write the results, if at the end of the loop, none of the controls returned anything, then you may be faced with the cold hard truth of not being able to automate this particular option. The other side, the positive side, would be that one of the controls gave you a result, and thus you would have the correct ClassNameNN then to work with.

I don't have anything to test it, so this is only my 2 cents worth (hope you don't need change :lmao: ).

@PsaltyDS - Did you bring me to this thread to see I don't comment my code much... If that was the case... if you read anything I ever write, I usually state that anyway :P ... but in this case, I thought I had dummy proofed that code with the header :whistle:

@SmOke_N - I brought you in to bail my butt out of a sea of confusion, Oh mighty Genie of the lamp... ;)

@JeffHarris - Run SmOke_N's _WinGetCtrlInfo() and look specifically at the SysListView32NN controls. SWT_WindowNN is a window class, not a control class. At most, it's an embedded window in the parent. Get the list of SysListView32NN controls and see what you get from them. I have no idea why you are getting results using a control class as your window identity, but I'm not going to be distracted by it any more.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

@SmOke_N - I brought you in to bail my butt out of a sea of confusion, Oh mighty Genie of the lamp... :whistle:

@JeffHarris - Run SmOke_N's _WinGetCtrlInfo() and look specifically at the SysListView32NN controls. SWT_WindowNN is a window class, not a control class. At most, it's an embedded window in the parent. Get the list of SysListView32NN controls and see what you get from them. I have no idea why you are getting results using a control class as your window identity, but I'm not going to be distracted by it any more.

:lmao:

I will try the suggestions and post the results (may be a couple of days due to work schedules). Thanx.

As an FYI: I also tried using Quick Test Pro to get at the RAD6 panels, and that didn't even get as far AutoIt did. It really irks me no end when a software company -- especially one like Rational or IBM -- won't use standard controls on their interfaces. I used to write Wise Installmaster scripts as containers for all the applications (shrinkwrapped as well as in-house) to be distributed to the employees here. Sure enough, the installations that gave me the most grief were the ones written by the Big Dogs that felt it necessary to "customize" their software -- sometimes going so far as to write the entire set-up procedure themselves -- and disdaining the mundane standards. Idiots.....

Link to comment
Share on other sites

My word... Ok, this is what I executed:

CODE

WinWait("Customize Perspective", "")

WinActivate("Customize Perspective", "")

Global $Array = _WinGetCtrlInfo(WinGetTitle("Customize Perspective", ""))

Global $sOne = '[0][0] = ' & $Array[0][0] & @CR, $sTwo

For $iCC = 1 To $Array[0][0]

$sOne &= '[' & $iCC & '][0] = ' & $Array[$iCC][0] & @CR

$sTwo &= '[' & $iCC & '][1] = ' & $Array[$iCC][1] & @CR

Next

MsgBox(4096, "Debugging...", StringTrimRight($sOne, 1) & @CR & StringTrimRight($sTwo, 1))

And this is what I received back:

CODE

[0][0] = 38

[1][0] = Button1

[2][0] = Button2

[3][0] = SWT_Window01

[4][0] = SWT_Window02

[5][0] = SWT_Window03

[6][0] = SWT_Window04

[7][0] = SWT_Window05

[8][0] = SWT_Window06

[9][0] = SWT_Window07

[10][0] = SWT_Window08

[11][0] = SWT_Window09

[12][0] = SWT_Window010

[13][0] = SWT_Window011

[14][0] = SWT_Window012

[15][0] = SWT_Window013

[16][0] = SWT_Window014

[17][0] = Static1

[18][0] = Static2

[19][0] = Static3

[20][0] = Static4

[21][0] = Static5

[22][0] = Static6

[23][0] = Static7

[24][0] = Static8

[25][0] = Static9

[26][0] = Static10

[27][0] = Static11

[28][0] = SysHeader321

[29][0] = SysHeader322

[30][0] = SysHeader323

[31][0] = SysHeader324

[32][0] = SysHeader321

[33][0] = SysHeader322

[34][0] = SysHeader323

[35][0] = SysHeader324

[36][0] = SysHeader321

[37][0] = ComboBox1

[38][0] = SysTabControl321

[1][1] = 131908

[2][1] = 131900

[3][1] = 131864

[4][1] = 131860

[5][1] = 131850

[6][1] = 131836

[7][1] = 131842

[8][1] = 131814

[9][1] = 131892

[10][1] = 131804

[11][1] = 131774

[12][1] = 131790

[13][1] = 131778

[14][1] = 131774

[15][1] = 131888

[16][1] = 131912

[17][1] = 131844

[18][1] = 131846

[19][1] = 131838

Beyond this point the window dropped off the bottom of the screen and I couldn't get it to reformat to view the remainder. :lmao:

After that, yesterday's debug statements...

CODE

Global $Control_To_Interact_With_Is = _CtrlGetByPos("classname=SysListView32", "", 212, 164, 3) ; All three values

If @error Then

MsgBox(16, "Error", "Error from _CtrlGetByPos(), @error = " & @error)

Else

_ArrayDisplay($Control_To_Interact_With_Is, "Debug:_CtrlGetByPos")

EndIf

...kicked in:

CODE

Debug:_CtrlGetByPos

Row Col 0

[0] 4

[1] 131864

[2] SWT_Window01

[3] 0x00020318

Wow..... :whistle:

Link to comment
Share on other sites

  • Moderators

My word... Ok, this is what I executed:

CODE

WinWait("Customize Perspective", "")

WinActivate("Customize Perspective", "")

Global $Array = _WinGetCtrlInfo(WinGetTitle("Customize Perspective", ""))

Global $sOne = '[0][0] = ' & $Array[0][0] & @CR, $sTwo

For $iCC = 1 To $Array[0][0]

$sOne &= '[' & $iCC & '][0] = ' & $Array[$iCC][0] & @CR

$sTwo &= '[' & $iCC & '][1] = ' & $Array[$iCC][1] & @CR

Next

MsgBox(4096, "Debugging...", StringTrimRight($sOne, 1) & @CR & StringTrimRight($sTwo, 1))

And this is what I received back:

CODE

[0][0] = 38

[1][0] = Button1

[2][0] = Button2

[3][0] = SWT_Window01

[4][0] = SWT_Window02

[5][0] = SWT_Window03

[6][0] = SWT_Window04

[7][0] = SWT_Window05

[8][0] = SWT_Window06

[9][0] = SWT_Window07

[10][0] = SWT_Window08

[11][0] = SWT_Window09

[12][0] = SWT_Window010

[13][0] = SWT_Window011

[14][0] = SWT_Window012

[15][0] = SWT_Window013

[16][0] = SWT_Window014

[17][0] = Static1

[18][0] = Static2

[19][0] = Static3

[20][0] = Static4

[21][0] = Static5

[22][0] = Static6

[23][0] = Static7

[24][0] = Static8

[25][0] = Static9

[26][0] = Static10

[27][0] = Static11

[28][0] = SysHeader321

[29][0] = SysHeader322

[30][0] = SysHeader323

[31][0] = SysHeader324

[32][0] = SysHeader321

[33][0] = SysHeader322

[34][0] = SysHeader323

[35][0] = SysHeader324

[36][0] = SysHeader321

[37][0] = ComboBox1

[38][0] = SysTabControl321

[1][1] = 131908

[2][1] = 131900

[3][1] = 131864

[4][1] = 131860

[5][1] = 131850

[6][1] = 131836

[7][1] = 131842

[8][1] = 131814

[9][1] = 131892

[10][1] = 131804

[11][1] = 131774

[12][1] = 131790

[13][1] = 131778

[14][1] = 131774

[15][1] = 131888

[16][1] = 131912

[17][1] = 131844

[18][1] = 131846

[19][1] = 131838

Beyond this point the window dropped off the bottom of the screen and I couldn't get it to reformat to view the remainder. ;)

After that, yesterday's debug statements...

CODE

Global $Control_To_Interact_With_Is = _CtrlGetByPos("classname=SysListView32", "", 212, 164, 3) ; All three values

If @error Then

MsgBox(16, "Error", "Error from _CtrlGetByPos(), @error = " & @error)

Else

_ArrayDisplay($Control_To_Interact_With_Is, "Debug:_CtrlGetByPos")

EndIf

...kicked in:

CODE

Debug:_CtrlGetByPos

Row Col 0

[0] 4

[1] 131864

[2] SWT_Window01

[3] 0x00020318

Wow..... :lmao:
Edit:

Just noticed that what I wrote was in your quote not sure how that happened :whistle:

Original Reply:

That test is kind of redundant really... You didn't use the ListView function like I suggested to find out what the return was using ConsoleWrite() like I suggested.... Really, you're exactly where you were yesterday.

Edited by SmOke_N

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.

Link to comment
Share on other sites

Edit:

Just noticed that what I wrote was in your quote not sure how that happened :whistle:

Original Reply:

That test is kind of redundant really... You didn't use the ListView function like I suggested to find out what the return was using ConsoleWrite() like I suggested.... Really, you're exactly where you were yesterday.

Ah, I must have missed the detail about using ConsoleWrite(). :lmao:

Ok, I'll ammend the code and try it again. Thanx again for your help and patience.

Link to comment
Share on other sites

Holy crap....

Ok, this is the code I set in place:

CODE

Func Debugging()

MsgBox(4096, "Debugging...", "Entering the Debugging function...")

; Alter the method used to match window titles: 4 = Advanced mode...

AutoItSetOption ("WinTitleMatchMode", 4)

; Set focus on the appropriate panel...

WinWait("Customize Perspective", "")

WinActivate("Customize Perspective", "")

; Define the array to be returned from the _WinGetCtrlInfo function...

Global $Array = _WinGetCtrlInfo(WinGetTitle("Customize Perspective", ""))

; Create a text file to use while debugging...

$file = FileOpen("L:\ITWebSysDoc\Version Control\AutoIt Stuff\AutoIt v3\Script Examples\StarTeamRAD6InterfaceTest\DebugOutput.txt", 10) ; which is similar to 2 + 8 (erase + create dir)

If $file = -1 Then

MsgBox(0, "Debugging...", "Error: Unable to open text file.")

Exit

Else

FileWriteLine($file, 'Total array count: [0][0] = ' & $Array[0][0])

For $iCC = 1 To $Array[0][0]

; Record events for posterity...

FileWriteLine($file, 'ClassNameNN: [' & $iCC & '][0] = ' & $Array[$iCC][0] & ', ControlID: [' & $iCC & '][1] = ' & $Array[$iCC][1])

; Set a visual cue...

ControlHide("Customize Perspective", "", $Array[$iCC][1])

MsgBox(4096, "Debugging...", "Check to see which control has been hidden...")

Next

EndIf

FileClose($file)

MsgBox(4096, "Debugging...", "Leaving the Debugging function...")

EndFunc

And when I ran it, two things happened:

(1) I got just a few steps into the loop when the ENTIRE PANEL BLANKED OUT, i.e. every control on the panel was hidden (though the IDE window beneath it was unaffected).

(2) I was writing to my text file, and recorded the first weird control when the above happened. To wit:

Total array count: [0][0] = 37

ClassNameNN: [1][0] = Button1, ControlID: [1][1] = 787336

ClassNameNN: [2][0] = Button2, ControlID: [2][1] = 3998618

ClassNameNN: [3][0] = SWT_Window01, ControlID: [3][1] = 1049520

I am stumped. Completely. I am afraid I am going to have to accept your assessment that I "may be faced with the cold hard truth of not being able to automate this particular option".

:whistle:

Link to comment
Share on other sites

  • Moderators

:whistle:

I don't mean to poke really, but let's use a bit of common sense here.... If we are going to hide a control, we should be watching to see what control is hid... then use ControlShow() afterwards to see what happened....

Anyway, I was suggesting you doing it 1 by 1 until you saw the list view hidden, but putting it in a loop is just going to hide them quickly... so here's another method maybe of debugging....

WinWait('Customize Perspective')
_Debug('Customize Perspective', 'L:\ITWebSysDoc\Version Control\AutoIt Stuff\AutoIt v3\Script Examples\StarTeamRAD6InterfaceTest\DebugOutput.txt')

Func _Debug($hWnd, $hDebugFile)
    If IsString($hWnd) And WinExists($hWnd) Then $hWnd = WinGetHandle($hWnd)
    Local $aWGCI = _WinGetCtrlInfo($hWnd)
    If IsArray($aWGCI) = 0 Then Return SetError(1, 0, '')
    FileClose(FileOpen($hDebugFile, 10))
    Local $hOutput = 'Total Controls = ' & $aWGCI[0][0] & @CRLF, $nLVCount
    For $iCC = 1 To $aWGCI[0][0]
        $hOutput &= 'ClassNameNN: [' & $iCC & '][0] = ' & $aWGCI[$iCC][0] & ', ControlID: [' & $iCC & '][1] = ' & $aWGCI[$iCC][1] & @CRLF
        ControlFocus($hWnd, '', $aWGCI[$iCC][0])
        ControlListView($hWnd, '', $aWGCI[$iCC][0], 'SelectAll')
        $nLVCount = ControlListView($hWnd, '', $aWGCI[$iCC][0], 'GetSelectedCount')
        If $nLVCount Then
            $hOutput &= 'Count = ' & $nLVCount & @CRLF
        Else
            $hOutput &= 'Either no items or is not LV' & @CRLF
        EndIf
    Next
    Return FileWrite($hDebugFile, $hOutput)
EndFunc
This was more what I had in mind, you may try this, if it doesn't work then replace the native LV functions with your custom ones you were using.

There may be errors, I wrote this in the reply plane so I am not sure if all the syntax is correct.

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.

Link to comment
Share on other sites

:whistle:

I don't mean to poke really....

Go ahead, I deserve it (I'm an obvious newbie here). :lmao:

Well, I ran the code -- which worked the first time, by the way -- and got some interesting results. Not sure what to make of it:

CODE

Total Controls = 37

ClassNameNN: [1][0] = Button1, ControlID: [1][1] = 131652

Either no items or is not LV

ClassNameNN: [2][0] = Button2, ControlID: [2][1] = 1704370

Either no items or is not LV

ClassNameNN: [3][0] = SWT_Window01, ControlID: [3][1] = 983488

Either no items or is not LV

ClassNameNN: [4][0] = SWT_Window02, ControlID: [4][1] = 918144

Either no items or is not LV

ClassNameNN: [5][0] = SWT_Window03, ControlID: [5][1] = 131664

Either no items or is not LV

ClassNameNN: [6][0] = SWT_Window04, ControlID: [6][1] = 262700

Either no items or is not LV

ClassNameNN: [7][0] = SWT_Window05, ControlID: [7][1] = 131700

Either no items or is not LV

ClassNameNN: [8][0] = SWT_Window06, ControlID: [8][1] = 131692

Either no items or is not LV

ClassNameNN: [9][0] = SWT_Window07, ControlID: [9][1] = 131648

Either no items or is not LV

ClassNameNN: [10][0] = SWT_Window08, ControlID: [10][1] = 131640

Either no items or is not LV

ClassNameNN: [11][0] = SWT_Window09, ControlID: [11][1] = 131698

Either no items or is not LV

ClassNameNN: [12][0] = SWT_Window010, ControlID: [12][1] = 131654

Either no items or is not LV

ClassNameNN: [13][0] = SWT_Window011, ControlID: [13][1] = 131656

Either no items or is not LV

ClassNameNN: [14][0] = SWT_Window012, ControlID: [14][1] = 1900982

Either no items or is not LV

ClassNameNN: [15][0] = SWT_Window013, ControlID: [15][1] = 131650

Either no items or is not LV

ClassNameNN: [16][0] = Static1, ControlID: [16][1] = 131660

Either no items or is not LV

ClassNameNN: [17][0] = Static2, ControlID: [17][1] = 131714

Either no items or is not LV

ClassNameNN: [18][0] = Static3, ControlID: [18][1] = 197166

Either no items or is not LV

ClassNameNN: [19][0] = Static4, ControlID: [19][1] = 131674

Either no items or is not LV

ClassNameNN: [20][0] = Static5, ControlID: [20][1] = 918178

Either no items or is not LV

ClassNameNN: [21][0] = Static6, ControlID: [21][1] = 131638

Either no items or is not LV

ClassNameNN: [22][0] = Static7, ControlID: [22][1] = 131702

Either no items or is not LV

ClassNameNN: [23][0] = Static8, ControlID: [23][1] = 131696

Either no items or is not LV

ClassNameNN: [24][0] = Static9, ControlID: [24][1] = 131704

Either no items or is not LV

ClassNameNN: [25][0] = Static10, ControlID: [25][1] = 1376892

Either no items or is not LV

ClassNameNN: [26][0] = Static11, ControlID: [26][1] = 655898

Either no items or is not LV

ClassNameNN: [27][0] = SysHeader321, ControlID: [27][1] = 0

Either no items or is not LV

ClassNameNN: [28][0] = SysHeader322, ControlID: [28][1] = 0

Either no items or is not LV

ClassNameNN: [29][0] = SysHeader323, ControlID: [29][1] = 0

Either no items or is not LV

ClassNameNN: [30][0] = SysHeader324, ControlID: [30][1] = 0

Either no items or is not LV

ClassNameNN: [31][0] = SysListView321, ControlID: [31][1] = 131642

Either no items or is not LV

ClassNameNN: [32][0] = SysListView322, ControlID: [32][1] = 197230

Count = 1

ClassNameNN: [33][0] = SysListView323, ControlID: [33][1] = 1311366

Either no items or is not LV

ClassNameNN: [34][0] = SysListView324, ControlID: [34][1] = 2228754

Count = 3

ClassNameNN: [35][0] = SysTreeView321, ControlID: [35][1] = 131662

Either no items or is not LV

ClassNameNN: [36][0] = ComboBox1, ControlID: [36][1] = 197246

Either no items or is not LV

ClassNameNN: [37][0] = SysTabControl321, ControlID: [37][1] = 786882

Either no items or is not LV

What I find the most perplexing is that there are only *seven* controls visible on the panel: two tabs, three LVs, and two buttons, plus a couple of static text fields. Where's the rest of this stuff coming from? And the LV I am trying to penetrate has 59 items displayed in it...
Link to comment
Share on other sites

Go ahead, I deserve it (I'm an obvious newbie here). :whistle:

Well, I ran the code -- which worked the first time, by the way -- and got some interesting results. Not sure what to make of it:

What I find the most perplexing is that there are only *seven* controls visible on the panel: two tabs, three LVs, and two buttons, plus a couple of static text fields. Where's the rest of this stuff coming from? And the LV I am trying to penetrate has 59 items displayed in it...

A tweak to SmOke_N's code to display IsVisible and IsEnabled status. Replace the For/Next loop with this:

For $iCC = 1 To $aWGCI[0][0]
        $hOutput &= 'ClassNameNN: [' & $iCC & '][0] = ' & $aWGCI[$iCC][0] & ', ControlID: [' & $iCC & '][1] = ' & $aWGCI[$iCC][1] & @CRLF
        ControlFocus($hWnd, '', $aWGCI[$iCC][0])
        If ControlCommand($hWnd, '', $aWGCI[$iCC][0], "IsVisible") Then
            $hOutput &= 'Control visible' & @CRLF
        Else
            $hOutput &= 'Control NOT visible' & @CRLF
        EndIf
        If ControlCommand($hWnd, '', $aWGCI[$iCC][0], "IsEnabled") Then
            $hOutput &= 'Control enabled' & @CRLF
        Else
            $hOutput &= 'Control DISABLED' & @CRLF
        EndIf
        ControlListView($hWnd, '', $aWGCI[$iCC][0], 'SelectAll')
        $nLVCount = ControlListView($hWnd, '', $aWGCI[$iCC][0], 'GetSelectedCount')
        If $nLVCount Then
            $hOutput &= 'Count = ' & $nLVCount & @CRLF
        Else
            $hOutput &= 'Either no items or is not LV' & @CRLF
        EndIf
    Next

:lmao:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • Moderators

Not much for chasing my tail... which is what we are doing at the moment.

What is the application name and where can I get it to test? If it's a secret ... and you still want to know, I'd suggest PMing the way to get it to myself or PsaltyDS (or both).

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.

Link to comment
Share on other sites

Not much for chasing my tail... which is what we are doing at the moment.

What is the application name and where can I get it to test? If it's a secret ... and you still want to know, I'd suggest PMing the way to get it to myself or PsaltyDS (or both).

No secrets here: IBM/Rational RAD6, and Borland StarTeam. I'm the local StarTeam Admin (for our division...the big dogs sit at the corporate office elsewhere). Since we get the occasional upgrade to both products, my boss thought it would be beneficial to have a script in place that would open RAD6, look for the telltales that it is talking properly to StarTeam, maybe ring a bell or two, and then close. Sounds simple, and it was for a while...right up until I opened the Customize Properties panel to look at the three StarTeam items listed. I have been unable to do anything more than tab around the controls visible on the panel.

Unless you folks already have the licensing issues worked out, I doubt if you'll be able to get copies of either product. Neither vendor is known for its generosity or distributing "trial copies" of its products...

Link to comment
Share on other sites

A tweak to SmOke_N's code to display IsVisible and IsEnabled status. Replace the For/Next loop with this:

:lmao:

Well, this issue has been a real pain in the tush, but it has shown me some neat code so far. Thanx! :whistle:

Here are the results of the above test:

CODE

Total Controls = 37

ClassNameNN: [1][0] = Button1, ControlID: [1][1] = 131982

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [2][0] = Button2, ControlID: [2][1] = 131968

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [3][0] = SWT_Window01, ControlID: [3][1] = 459304

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [4][0] = SWT_Window02, ControlID: [4][1] = 197448

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [5][0] = SWT_Window03, ControlID: [5][1] = 131994

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [6][0] = SWT_Window04, ControlID: [6][1] = 131952

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [7][0] = SWT_Window05, ControlID: [7][1] = 131990

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [8][0] = SWT_Window06, ControlID: [8][1] = 131978

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [9][0] = SWT_Window07, ControlID: [9][1] = 131964

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [10][0] = SWT_Window08, ControlID: [10][1] = 131956

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [11][0] = SWT_Window09, ControlID: [11][1] = 131954

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [12][0] = SWT_Window010, ControlID: [12][1] = 131946

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [13][0] = SWT_Window011, ControlID: [13][1] = 131948

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [14][0] = SWT_Window012, ControlID: [14][1] = 131950

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [15][0] = SWT_Window013, ControlID: [15][1] = 131988

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [16][0] = Static1, ControlID: [16][1] = 131914

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [17][0] = Static2, ControlID: [17][1] = 131916

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [18][0] = Static3, ControlID: [18][1] = 131958

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [19][0] = Static4, ControlID: [19][1] = 131972

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [20][0] = Static5, ControlID: [20][1] = 131980

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [21][0] = Static6, ControlID: [21][1] = 131966

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [22][0] = Static7, ControlID: [22][1] = 131962

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [23][0] = Static8, ControlID: [23][1] = 131920

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [24][0] = Static9, ControlID: [24][1] = 131944

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [25][0] = Static10, ControlID: [25][1] = 131928

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [26][0] = Static11, ControlID: [26][1] = 131922

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [27][0] = SysHeader321, ControlID: [27][1] = 0

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [28][0] = SysHeader322, ControlID: [28][1] = 0

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [29][0] = SysHeader323, ControlID: [29][1] = 0

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [30][0] = SysHeader324, ControlID: [30][1] = 0

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [31][0] = SysListView321, ControlID: [31][1] = 131976

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [32][0] = SysListView322, ControlID: [32][1] = 131926

Control visible

Control enabled

Count = 1

ClassNameNN: [33][0] = SysListView323, ControlID: [33][1] = 131938

Control visible

Control enabled

Count = 2

ClassNameNN: [34][0] = SysListView324, ControlID: [34][1] = 131934

Control visible

Control enabled

Count = 2

ClassNameNN: [35][0] = SysTreeView321, ControlID: [35][1] = 131984

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [36][0] = ComboBox1, ControlID: [36][1] = 132000

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [37][0] = SysTabControl321, ControlID: [37][1] = 131992

Control visible

Control enabled

Either no items or is not LV

Ok, this did help me determine a couple of things:

(1) The three items highlited above are the actual LV's, because before running the code I randomly picked one item in the first LV that provided corresponding results in the other two LV's. And in these latter two LV's, each has one item and one sub-item displayed.

(2) Even though there are 59 items in the first LV, for whatever reason the above list shows that only one item is showing. I was under the impression that you would be able to get a total item count out of a standard LV, scan all items for specifc text, loop through all items and inspect/modify each, etc. Am I wrong in this?

Is there any way to attach a screen print here, so you folks can see what I'm seeing, besides posting the image to a server somewhere? This just gets better and better...

Did I say thanx yet for all your help?

Edited by JeffHarris
Link to comment
Share on other sites

  • Moderators

Well, this issue has been a real pain in the tush, but it has shown me some neat code so far. Thanx! :whistle:

Here are the results of the above test:

CODE

Total Controls = 37

ClassNameNN: [1][0] = Button1, ControlID: [1][1] = 131982

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [2][0] = Button2, ControlID: [2][1] = 131968

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [3][0] = SWT_Window01, ControlID: [3][1] = 459304

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [4][0] = SWT_Window02, ControlID: [4][1] = 197448

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [5][0] = SWT_Window03, ControlID: [5][1] = 131994

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [6][0] = SWT_Window04, ControlID: [6][1] = 131952

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [7][0] = SWT_Window05, ControlID: [7][1] = 131990

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [8][0] = SWT_Window06, ControlID: [8][1] = 131978

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [9][0] = SWT_Window07, ControlID: [9][1] = 131964

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [10][0] = SWT_Window08, ControlID: [10][1] = 131956

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [11][0] = SWT_Window09, ControlID: [11][1] = 131954

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [12][0] = SWT_Window010, ControlID: [12][1] = 131946

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [13][0] = SWT_Window011, ControlID: [13][1] = 131948

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [14][0] = SWT_Window012, ControlID: [14][1] = 131950

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [15][0] = SWT_Window013, ControlID: [15][1] = 131988

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [16][0] = Static1, ControlID: [16][1] = 131914

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [17][0] = Static2, ControlID: [17][1] = 131916

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [18][0] = Static3, ControlID: [18][1] = 131958

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [19][0] = Static4, ControlID: [19][1] = 131972

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [20][0] = Static5, ControlID: [20][1] = 131980

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [21][0] = Static6, ControlID: [21][1] = 131966

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [22][0] = Static7, ControlID: [22][1] = 131962

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [23][0] = Static8, ControlID: [23][1] = 131920

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [24][0] = Static9, ControlID: [24][1] = 131944

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [25][0] = Static10, ControlID: [25][1] = 131928

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [26][0] = Static11, ControlID: [26][1] = 131922

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [27][0] = SysHeader321, ControlID: [27][1] = 0

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [28][0] = SysHeader322, ControlID: [28][1] = 0

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [29][0] = SysHeader323, ControlID: [29][1] = 0

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [30][0] = SysHeader324, ControlID: [30][1] = 0

Control visible

Control enabled

Either no items or is not LV

ClassNameNN: [31][0] = SysListView321, ControlID: [31][1] = 131976

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [32][0] = SysListView322, ControlID: [32][1] = 131926

Control visible

Control enabled

Count = 1

ClassNameNN: [33][0] = SysListView323, ControlID: [33][1] = 131938

Control visible

Control enabled

Count = 2

ClassNameNN: [34][0] = SysListView324, ControlID: [34][1] = 131934

Control visible

Control enabled

Count = 2

ClassNameNN: [35][0] = SysTreeView321, ControlID: [35][1] = 131984

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [36][0] = ComboBox1, ControlID: [36][1] = 132000

Control NOT visible

Control enabled

Either no items or is not LV

ClassNameNN: [37][0] = SysTabControl321, ControlID: [37][1] = 131992

Control visible

Control enabled

Either no items or is not LV

Ok, this did help me determine a couple of things:

(1) The three items highlited above are the actual LV's, because before running the code I randomly picked one item in the first LV that provided corresponding results in the other two LV's. And in these latter two LV's, each has one item and one sub-item displayed.

(2) Even though there are 59 items in the first LV, for whatever reason the above list shows that only one item is showing. I was under the impression that you would be able to get a total item count out of a standard LV, scan all items for specifc text, loop through all items and inspect/modify each, etc. Am I wrong in this?

Is there any way to attach a screen print here, so you folks can see what I'm seeing, besides posting the image to a server somewhere? This just gets better and better...

Did I say thanx yet for all your help?

As far as the screen pic, you'd be better off uploading it to a free server then just providing the link, it takes up the limited room you have in your uploads... but if you choose to upload, there's an insert image button option right next to the smiley faces in the Full Response/Edit plane here.

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.

Link to comment
Share on other sites

As far as the screen pic, you'd be better off uploading it to a free server then just providing the link, it takes up the limited room you have in your uploads... but if you choose to upload, there's an insert image button option right next to the smiley faces in the Full Response/Edit plane here.

I saw the Insert Image button, but declined to use it (I was hoping there was a way to just paste an image directly into the upload...within reason, of course). Can you recommend a free server?

Link to comment
Share on other sites

  • Moderators

I've never used them, for autoit I just use my filemanager http://www.autoitscript.com/fileman/index.php? but I don't know if it's still an option to sign up or not.

Anyway... google turned this out: http://www.freepicturehosting.com/faqs.php I don't know how reliable they are though.

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.

Link to comment
Share on other sites

I've never used them, for autoit I just use my filemanager http://www.autoitscript.com/fileman/index.php? but I don't know if it's still an option to sign up or not.

Anyway... google turned this out: http://www.freepicturehosting.com/faqs.php I don't know how reliable they are though.

Well, I opened an account with Photobucket. Should work, I guess. Anyway, try this:

Screenprints of the Customize Perspective panel.

Let me know if you can't see, I'll try something else.

Edited by JeffHarris
Link to comment
Share on other sites

Ok, I decided to tinker around a bit today, so I changed the code...

CODE

Func _Debug($hWnd, $hDebugFile)

If IsString($hWnd) And WinExists($hWnd) Then $hWnd = WinGetHandle($hWnd)

Local $aWGCI = _WinGetCtrlInfo($hWnd)

If IsArray($aWGCI) = 0 Then Return SetError(1, 0, '')

FileClose(FileOpen($hDebugFile, 10))

Local $hOutput = 'Total Controls = ' & $aWGCI[0][0] & @CRLF, $nLVCount

For $iCC = 1 To $aWGCI[0][0]

$hOutput &= 'ClassNameNN: [' & $iCC & '][0] = ' & $aWGCI[$iCC][0] & ', ControlID: [' & $iCC & '][1] = ' & $aWGCI[$iCC][1] & @CRLF

ControlFocus($hWnd, '', $aWGCI[$iCC][0])

If ControlCommand($hWnd, '', $aWGCI[$iCC][0], "IsVisible") Then

$hOutput &= ' Control VISIBLE' & @CRLF

Else

$hOutput &= ' Control not visible' & @CRLF

EndIf

If ControlCommand($hWnd, '', $aWGCI[$iCC][0], "IsEnabled") Then

$hOutput &= ' Control ENABLED' & @CRLF

;.....................................................

$var = ControlGetText($hWnd, '', $aWGCI[$iCC][0])

$hOutput &= ' Text content: ' & $var & @CRLF

;.....................................................

Else

$hOutput &= ' Control disabled' & @CRLF

EndIf

ControlListView($hWnd, '', $aWGCI[$iCC][0], 'SelectAll')

$nLVCount = ControlListView($hWnd, '', $aWGCI[$iCC][0], 'GetSelectedCount')

If $nLVCount Then

$hOutput &= ' ***** GET SELECTED COUNT = ' & $nLVCount & @CRLF

;.....................................................

$indexlist = ControlListView($hWnd, '', $aWGCI[$iCC][0], "GetSelected", 1)

$hOutput &= ' ***** GET SELECTED INDEXES = ' & $indexlist & @CRLF

For $iCnt = 1 to $nLVCount

$LVtext = ControlListView($hWnd, '', $aWGCI[$iCC][0], "GetText", $iCnt, 0)

$hOutput &= ' ***** GET SELECTED TEXT = ' & $LVtext & @CRLF

Next

;.....................................................

Else

$hOutput &= ' Either no items or is not LV' & @CRLF

EndIf

Next

MsgBox(4096, "Debugging...", "_Debug function complete.")

Return FileWrite($hDebugFile, $hOutput)

EndFunc

...and then ran it...

CODE

Total Controls = 38

ClassNameNN: [1][0] = Button1, ControlID: [1][1] = 132124

Control VISIBLE

Control ENABLED

Text content: OK

Either no items or is not LV

ClassNameNN: [2][0] = Button2, ControlID: [2][1] = 132108

Control VISIBLE

Control ENABLED

Text content: Cancel

Either no items or is not LV

ClassNameNN: [3][0] = SWT_Window01, ControlID: [3][1] = 656358

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [4][0] = SWT_Window02, ControlID: [4][1] = 459774

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [5][0] = SWT_Window03, ControlID: [5][1] = 2294780

Control not visible

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [6][0] = SWT_Window04, ControlID: [6][1] = 3081188

Control not visible

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [7][0] = SWT_Window05, ControlID: [7][1] = 3802100

Control not visible

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [8][0] = SWT_Window06, ControlID: [8][1] = 132172

Control not visible

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [9][0] = SWT_Window07, ControlID: [9][1] = 132118

Control not visible

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [10][0] = SWT_Window08, ControlID: [10][1] = 132178

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [11][0] = SWT_Window09, ControlID: [11][1] = 132164

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [12][0] = SWT_Window010, ControlID: [12][1] = 132166

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [13][0] = SWT_Window011, ControlID: [13][1] = 132140

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [14][0] = SWT_Window012, ControlID: [14][1] = 132144

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [15][0] = SWT_Window013, ControlID: [15][1] = 132116

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [16][0] = SWT_Window014, ControlID: [16][1] = 132128

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [17][0] = Static1, ControlID: [17][1] = 3343354

Control not visible

Control ENABLED

Text content: Select the shortcuts that you want to see added as cascade items to the following submenus. The selections made will only affect the current perspective (J2EE).

Either no items or is not LV

ClassNameNN: [18][0] = Static2, ControlID: [18][1] = 721814

Control not visible

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [19][0] = Static3, ControlID: [19][1] = 2294754

Control not visible

Control ENABLED

Text content: Submenus:

Either no items or is not LV

ClassNameNN: [20][0] = Static4, ControlID: [20][1] = 1246168

Control not visible

Control ENABLED

Text content: Shortcut Categories:

Either no items or is not LV

ClassNameNN: [21][0] = Static5, ControlID: [21][1] = 132096

Control not visible

Control ENABLED

Text content: Shortcuts:

Either no items or is not LV

ClassNameNN: [22][0] = Static6, ControlID: [22][1] = 132150

Control VISIBLE

Control ENABLED

Text content: Select the command groups that you want to see added to the current perspective (J2EE). The details field identifies which menu items and/or toolbar items are added to the perspective by the selected command group.

Either no items or is not LV

ClassNameNN: [23][0] = Static7, ControlID: [23][1] = 132152

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [24][0] = Static8, ControlID: [24][1] = 132158

Control VISIBLE

Control ENABLED

Text content: Available command groups:

Either no items or is not LV

ClassNameNN: [25][0] = Static9, ControlID: [25][1] = 132146

Control VISIBLE

Control ENABLED

Text content: Menubar Details:

Either no items or is not LV

ClassNameNN: [26][0] = Static10, ControlID: [26][1] = 132142

Control VISIBLE

Control ENABLED

Text content: Toolbar Details:

Either no items or is not LV

ClassNameNN: [27][0] = Static11, ControlID: [27][1] = 132126

Control VISIBLE

Control ENABLED

Text content: Use F2 to display the description for a selected command item.

Either no items or is not LV

ClassNameNN: [28][0] = SysHeader321, ControlID: [28][1] = 0

Control not visible

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [29][0] = SysHeader322, ControlID: [29][1] = 0

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [30][0] = SysHeader323, ControlID: [30][1] = 0

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [31][0] = SysHeader324, ControlID: [31][1] = 0

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [32][0] = SysListView321, ControlID: [32][1] = 132132

Control not visible

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [33][0] = SysListView322, ControlID: [33][1] = 132160

Control VISIBLE

Control ENABLED

Text content:

***** GET SELECTED COUNT = 1

***** GET SELECTED INDEXES = 50

***** GET SELECTED TEXT = Breakpoints

ClassNameNN: [34][0] = SysListView323, ControlID: [34][1] = 132136

Control VISIBLE

Control ENABLED

Text content:

***** GET SELECTED COUNT = 21

***** GET SELECTED INDEXES = 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20

***** GET SELECTED TEXT = Share Project...

***** GET SELECTED TEXT = Project >

***** GET SELECTED TEXT = New...

***** GET SELECTED TEXT = Properties

***** GET SELECTED TEXT = View >

***** GET SELECTED TEXT = New...

***** GET SELECTED TEXT = Select Configuration...

***** GET SELECTED TEXT = Properties

***** GET SELECTED TEXT = Promotion...

***** GET SELECTED TEXT = Labels...

***** GET SELECTED TEXT = Folder >

***** GET SELECTED TEXT = New...

***** GET SELECTED TEXT = Create Working Folders

***** GET SELECTED TEXT = Properties

***** GET SELECTED TEXT = Labels...

***** GET SELECTED TEXT = Advanced >

***** GET SELECTED TEXT = Behavior...

***** GET SELECTED TEXT = References...

***** GET SELECTED TEXT = Advanced >

***** GET SELECTED TEXT = Customize...

***** GET SELECTED TEXT =

ClassNameNN: [35][0] = SysListView324, ControlID: [35][1] = 132106

Control VISIBLE

Control ENABLED

Text content:

***** GET SELECTED COUNT = 15

***** GET SELECTED INDEXES = 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14

***** GET SELECTED TEXT = Synchronize outgoing changes to StarTeam Server

***** GET SELECTED TEXT = Synchronize outgoing changes to StarTeam Server and unlock file(s)

***** GET SELECTED TEXT = Synchronize incoming changes from StarTeam Server and lock file(s)

***** GET SELECTED TEXT = Synchronize incoming changes from StarTeam Server

***** GET SELECTED TEXT = Lock file(s)

***** GET SELECTED TEXT = Unlock file(s)

***** GET SELECTED TEXT = Synchronize StarTeam projects

***** GET SELECTED TEXT = Creates a new StarTeam Server Connection

***** GET SELECTED TEXT = Shares a workspace project with StarTeam

***** GET SELECTED TEXT = Create new StarTeam project

***** GET SELECTED TEXT = Create new view in StarTeam project

***** GET SELECTED TEXT = Create new folder(s) in StarTeam project

***** GET SELECTED TEXT = Create/complete link

***** GET SELECTED TEXT = Search for StarTeam items

***** GET SELECTED TEXT =

ClassNameNN: [36][0] = SysTreeView321, ControlID: [36][1] = 263158

Control not visible

Control ENABLED

Text content:

Either no items or is not LV

ClassNameNN: [37][0] = ComboBox1, ControlID: [37][1] = 1115112

Control not visible

Control ENABLED

Text content: New

Either no items or is not LV

ClassNameNN: [38][0] = SysTabControl321, ControlID: [38][1] = 1967096

Control VISIBLE

Control ENABLED

Text content:

Either no items or is not LV

AS you can see from the bold items above, I have two issues at this point that leave me scratching my head:

(1) Even though the first LV shows 50 indexes/items in it, it only returns a count of one, and when I do a GetText of that item, it is returning the text in the second item, not the first.

(2) What look like subitems in the LVs are being recorded as Items -- but I can successfully do a GetText on them. Major improvement. :whistle:

Link to comment
Share on other sites

  • Moderators

It has the right amount of indexes, is it selecting them all?

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.

Link to comment
Share on other sites

It has the right amount of indexes, is it selecting them all?

Yeah, I found that pretty quickly.

What I have been doing is just hammering the code with commands until I GOT IT TO WORK. Specifically:

CODE

Func Customize_Perpsective()

WinMenuSelectItem("J2EE - IBM Rational Software Development Platform", "", "&Window", "Customi&ze Perspective..." )

; Raise the "Customize Perspective" panel...

WinWait("Customize Perspective", "")

WinActivate("Customize Perspective", "")

; The default tab is "Shortcuts", but we need to be on the "Commands" tab...

Send("+{TAB}{RIGHT}")

; We need to process the "Available Command Groups" SysListView control, ClassNameNN = SysListView322...

ControlFocus("Customize Perspective", "", "SysListView322")

; Define an output text file to record debugging processes...

$hDisplayFile = 'L:\ITWebSysDoc\Version Control\AutoIt Stuff\AutoIt v3\Script Examples\StarTeamRAD6InterfaceTest\DebugDisplay.txt'

FileClose(FileOpen($hDisplayFile, 10))

Local $hDisplay = 'Results of walking through the SysListView322 Controls: ' & @CRLF

$hDisplay &= ' -------------- ' & @CRLF

$nLVTotal = ControlListView("Customize Perspective", "", "SysListView322", "GetItemCount")

MsgBox(4096, "Debugging...", "Item count of SysListView322 is " & $nLVTotal)

For $iLVcnt = 0 to $nLVTotal - 1

$sLVtext = ControlListView("Customize Perspective", "", "SysListView322", "GetText", $iLVcnt, 0)

$hDisplay &= "Text from Item " & $iLVcnt & " is " & $sLVtext

If StringInStr($sLVtext, "StarTeam") Then

$hDisplay &= " STARTEAM FOUND !!! "

If ControlListView("Customize Perspective", "", "SysListView322", "IsSelected", $iLVcnt) Then

$hDisplay &= " -- Item is selected" & @CRLF

Else

$hDisplay &= " -- Item is NOT selected" & @CRLF

EndIf

Else

$hDisplay &= " " & @CRLF

EndIf

Next

Return FileWrite($hDisplayFile, $hDisplay)

EndFunc

Which produced this:

CODE

Results of walking through the SysListView322 Controls:

--------------

Text from Item 0 is Annotation Navigation

Text from Item 1 is Breakpoints

Text from Item 2 is Cheat Sheets

Text from Item 3 is Compiled Debug

Text from Item 4 is Connector

Text from Item 5 is Convert Web Project Type

Text from Item 6 is Data Definition

Text from Item 7 is Debug

Text from Item 8 is Editor Navigation

Text from Item 9 is Editor Presentation

Text from Item 10 is EJB

Text from Item 11 is EJB

Text from Item 12 is EJB Deployment

Text from Item 13 is eSupportClient Action Set

Text from Item 14 is External Tools

Text from Item 15 is J2EE

Text from Item 16 is Java Coding

Text from Item 17 is Java Debug

Text from Item 18 is Javadoc with Diagrams

Text from Item 19 is Java Editor Presentation

Text from Item 20 is Java Element Creation

Text from Item 21 is Java Navigation

Text from Item 22 is Java Open Actions

Text from Item 23 is Java Search

Text from Item 24 is JUnit

Text from Item 25 is Launch

Text from Item 26 is Open External Files

Text from Item 27 is Page Designer Edit

Text from Item 28 is Page Designer Form

Text from Item 29 is Page Designer Format

Text from Item 30 is Page Designer Frame

Text from Item 31 is Page Designer Insert

Text from Item 32 is Page Designer Insert JSP

Text from Item 33 is Page Designer Style

Text from Item 34 is Page Designer Table

Text from Item 35 is Page Designer Tools

Text from Item 36 is Page Designer Views

Text from Item 37 is Process

Text from Item 38 is Profile

Text from Item 39 is Proxy Tools

Text from Item 40 is Resource Navigation

Text from Item 41 is SampleGalleryActionSetLabel

Text from Item 42 is Search

Text from Item 43 is Search...

Text from Item 44 is Serena Professional

Text from Item 45 is Server

Text from Item 46 is Software Updates

Text from Item 47 is Software Updates

Text from Item 48 is SQL/DDL Script

Text from Item 49 is SQL Statement

Text from Item 50 is StarTeam STARTEAM FOUND !!! -- Item is NOT selected

Text from Item 51 is StarTeam Commands STARTEAM FOUND !!! -- Item is NOT selected

Text from Item 52 is Team

Text from Item 53 is TutorialGalleryActionSetLabel

Text from Item 54 is View Definition

Text from Item 55 is Web Advanced

Text from Item 56 is Web Basic

Text from Item 57 is Web Browser

Text from Item 58 is Web Main

Text from Item 59 is Web Project

The above code works because you folks showed me how to peel back the surface and figure out what the heck is going on. Criminetly, what a chore. However, I can now find the item I need, and tell if it's selected or not. The last step is to actually select the item, which will preobably have to wait until next week.

Thanx, and have a great weekend! :whistle:

Edited by JeffHarris
Link to comment
Share on other sites

Well, I started messing around again. Each Item in the LV has the appearance of a checkbox (shown here), so I thought I would ping the identified Item to see if it's Checked.

Not suprisingly, that doesn't work.

Here's the modified code...

CODE

; Locate any/all StarTeam items and see what their status is -- and set them "ON"...

For $iLVcnt = 0 to $nLVTotal - 1

$sLVtext = ControlListView("Customize Perspective", "", "SysListView322", "GetText", $iLVcnt, 0)

$hDisplay &= "Text from Item " & $iLVcnt & " is " & $sLVtext

If StringInStr($sLVtext, "StarTeam") Then

$hDisplay &= " STARTEAM FOUND !!! "

If ControlListView("Customize Perspective", "", "SysListView322", "IsSelected", $iLVcnt) Then

$hDisplay &= " -- Item is selected" & @CRLF

Else

$hDisplay &= " -- Item is NOT selected" & @CRLF

ControlListView("Customize Perspective", "", "SysListView322", "Select", $iLVcnt)

EndIf

$hDisplay &= " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * " & @CRLF

If ControlCommand("Customize Perspective", "", "SysListView322", "IsChecked", "") Then

$hDisplay &= " Item is Checked " & @CRLF

Else

$hDisplay &= " Item is NOT Checked " & @CRLF

EndIf

$hDisplay &= " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * " & @CRLF

Else

$hDisplay &= " " & @CRLF

EndIf

Next

...and here the pertinent part of the output...

CODE

Text from Item 47 is Software Updates

Text from Item 48 is SQL/DDL Script

Text from Item 49 is SQL Statement

Text from Item 50 is StarTeam STARTEAM FOUND !!! -- Item is NOT selected

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Item is NOT Checked

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Text from Item 51 is StarTeam Commands STARTEAM FOUND !!! -- Item is NOT selected

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Item is NOT Checked

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Text from Item 52 is Team

Text from Item 53 is TutorialGalleryActionSetLabel

Text from Item 54 is View Definition

So, in summary:

* I can now select any given item, which causes a change in the contents of the corresponding LVs.

* I can now see the text contents of any given item in any LV.

* I cannot (so far) determine if an item is Checked.

* I cannot (so far) MouseClick or Check an Item in the significant LV.

Any suggestions?

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...