Jump to content

ListView32 control - getting and sending commands


Recommended Posts

:) Can anyone tell me how to acquire data from ListView32[1] control as an array (if there are more than one row and col) and how to send a command to a sepcific item, subitem.

all help is very appreciated

<{POST_SNAPBACK}>

Thanks, I know that much, but i'm clueless of how to do that on an existing window. The Help File gives an example but it makes it's own window. In other words, I'm new to this.

Thanks

Link to comment
Share on other sites

Not sure exactly what you are trying to do but the following will tell you the Items listed in the Temp Dir:

Opt("WinTitleMatchMode",2)
Run('explorer ' & @TempDir)
WinWait('Temp')
$ItemCount = ControlListView ( "Temp", "", "SysListView321","GetItemCount")
For $i = 0 To $ItemCount -1
    MsgBox(0,"",ControlListView ( "Temp", "", "SysListView321","GetText", $i))
Next
Link to comment
Share on other sites

Not sure exactly what you are trying to do but the following will tell you the Items listed in the Temp Dir:

Opt("WinTitleMatchMode",2)
Run('explorer ' & @TempDir)
WinWait('Temp')
$ItemCount = ControlListView ( "Temp", "", "SysListView321","GetItemCount")
For $i = 0 To $ItemCount -1
    MsgBox(0,"",ControlListView ( "Temp", "", "SysListView321","GetText", $i))
Next

<{POST_SNAPBACK}>

That's Excellent! Precisely what I needed. But How do you send, let's say, a CommandControl or CommandClick to item 1 subitem 2?

thanks

Link to comment
Share on other sites

That's Excellent! Precisely what I needed. But How do you send, let's say, a CommandControl or CommandClick to item 1 subitem 2?

thanks

<{POST_SNAPBACK}>

Are you trying to open a file from the listview ?

Not sure what your goal is here.

Please explain in detail.

Link to comment
Share on other sites

Are you trying to open a file from the listview ?

Not sure what your goal is here.

Please explain in detail.

<{POST_SNAPBACK}>

Yes, It's a chat server list, the lines get constanly updated with the amount of people in a room. I want to search for a name and open the room they're in and send a hello message. The lines [room names] don't have controls so I'm looking for a way to send a command to specific lines in a control, where each are links to other windows.

thanks

Edited by Bobbeyreay
Link to comment
Share on other sites

OK, I think I understand but am unable to test, of course you must fill in the specific noted details.

$WinTitle = 'EnterWindowTitleHere'          ;;Fill in details
$WinText = 'EnterWindowTextHere_OrLeaveBlank' ;;Fill in details
$Name = 'EnterNameHere'                    ;;Fill in details
$NameIndex = ControlListView($WinTitle,$WinText,'SysListView321',"FindItem",$Name)
If $NameIndex <> -1 Then
    ControlListView($WinTitle,$WinText,'SysListView321',"Select",$NameIndex)
    ControlSend($WinTitle,$WinText,'SysListView321','{ENTER}')
Else
    MsgBox(0,'Not Found',$Name & ' was not found.')
EndIf
Link to comment
Share on other sites

OK, I think I understand but am unable to test, of course you must fill in the specific noted details.

$WinTitle = 'EnterWindowTitleHere'            ;;Fill in details
$WinText = 'EnterWindowTextHere_OrLeaveBlank';;Fill in details
$Name = 'EnterNameHere'                      ;;Fill in details
$NameIndex = ControlListView($WinTitle,$WinText,'SysListView321',"FindItem",$Name)
If $NameIndex <> -1 Then
    ControlListView($WinTitle,$WinText,'SysListView321',"Select",$NameIndex)
    ControlSend($WinTitle,$WinText,'SysListView321','{ENTER}')
Else
    MsgBox(0,'Not Found',$Name & ' was not found.')
EndIf

<{POST_SNAPBACK}>

thanks, so all you have to do is select it? I thought there was a way to call out a control with an item number and a subitem number. that would have been a great option. Anyhow, many many thanks!
Link to comment
Share on other sites

  • 4 years later...

Not sure exactly what you are trying to do but the following will tell you the Items listed in the Temp Dir:

Opt("WinTitleMatchMode",2)
Run('explorer ' & @TempDir)
WinWait('Temp')
$ItemCount = ControlListView ( "Temp", "", "SysListView321","GetItemCount")
For $i = 0 To $ItemCount -1
    MsgBox(0,"",ControlListView ( "Temp", "", "SysListView321","GetText", $i))
Next
Thanks!! It also helped me alooot!!!
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...