Jump to content
Sign in to follow this  
caleb41610

[SOLVED]Get listview clicked & make array

Recommended Posts

caleb41610

$serverlist = GUICtrlCreateListView( "#|User Name|IP Address|Operating System|Office version|Administrator|In AD", 255, 5, 535, 370 )
$test1 = GUICtrlCreateListViewItem( "1|PC-1|192.168.0.2|Windows 7|2003|Yes|No", $serverlist )
$test2 = GUICtrlCreateListViewItem( "2|PC-2|192.168.0.3|Windows XP|2003|No|Yes", $serverlist )
$button = GUICtrlCreateButton( "test", 5, 5, 50, 50 )



While 1
$msg = GUIGetMsg( )
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $button
makearray( $selected )
EndSelect
WEnd


Func makearray( $selected )
; ??
EndFunc

How would I parse the selected one in to an array like this?

$array[1][1] = "1"

$array[1][2] = "Caleb"

etc.

I'm going to make a script to keep 23 office computers in line and tell me which ones need updating. I have most of the rest finished but for some reason this part has me stuck. I wrote an example snipped above .

Edited by caleb41610

Share this post


Link to post
Share on other sites
hannes08

Take a look at the helpfile for the GUICtrlCreateListViewItem() function.

The example states that somthing similar to this:

GUICtrlRead(GUICtrlRead($listview))

will return the contents of the actual selected item.

Use StringSplit() to get the line into an array.


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites
FireFox

Hi,

How would I parse the selected one in to an array

Take a look at _GUICtrlListView_ functions, especially _GUICtrlListView_GetItemText.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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  

×