Sign in to follow this  
Followers 0
Dragon10660

list view help

1 post in this topic

i need some help with this

can anyone point out how when i select something in the list

#include <GUIConstantsEx.au3>
#Include <GuiListView.au3>
#include <ButtonConstants.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $Client[1][1], $Array[1]

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 169, 300, 591)
$Label1 = GUICtrlCreateLabel("Program name?", 264, 8, 32, 17)
$Label3 = GUICtrlCreateLabel("X :", 264, 24, 17, 17)
$Label4 = GUICtrlCreateLabel("Y :", 328, 24, 17, 17)
$Char = GUICtrlCreateLabel("", 296, 8, 29, 17)
$xcoord1 = GUICtrlCreateLabel("", 295, 24, 10, 17)
$Y = GUICtrlCreateLabel("", 344, 24, 10, 17)
$listview = GUICtrlCreateListView("Client Name", 0, 8, 250, 150, BitOR($LVS_SORTDESCENDING, $LVS_LIST, $LVS_SHOWSELALWAYS));The right way to have multiple styles is with BitOr()
$Button5 = GUICtrlCreateButton("Exit", 336, 136, 75, 25)
$Button6 = GUICtrlCreateButton("Refresh", 256, 136, 72, 25)

$XInst = 140

_Refresh()
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button5
            Exit
        Case $Button6
            _Refresh()
    EndSwitch
    If _GUICtrlListView_GetSelectedIndices($listview) Then
$Go = ControlGetText($listview, "", "[CLASS:Static; INSTANCE:" & $XInst & "]")
GUICtrlSetData($xcoord1,$Go)

    EndIf
WEnd

Func _Refresh()
    _GUICtrlListView_BeginUpdate($listview)
    _GUICtrlListView_DeleteAllItems($listview)
    $Client = WinList("[CLASS:wxWindowClassNR]")
    If $Client[0][0] > 0 Then
        For $X = 1 To $Client[0][0]
            GUICtrlCreateListViewItem($Client[$X][0], $listview)
        Next
    Else
        GUICtrlCreateListViewItem("No Clients Found", $listview)
    EndIf
    _GUICtrlListView_EndUpdate($listview)
EndFunc  ;==>_Refresh

when i select something from the list it gets a controlgettext from that program AKA Some Text That Show differnt stuff each min

when i click on the thing it will get the thing from the control text from that window with the text

and update it when the text changes

but i cant it to work?

anyone can help i will appreciate it

ty

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