ghetek Posted March 16, 2006 Share Posted March 16, 2006 I cant seem to make this thing open up, it says that i need to dim something. dont mind the ini file. it just writes to, there is no reading from. expandcollapse popup#include <GUIConstants.au3> $db=@ScriptDir & "\Management.ini" GUICreate("listview items",220,250, 100,200,-1,$WS_EX_ACCEPTFILES) GUISetBkColor (0x00E0FFFF) ; will change background color $listview = GUICtrlCreateListView ("HostName|Ping Status|col3 ",10,10,200,150);,$LVS_SORTDESCENDING) $button = GUICtrlCreateButton ("Value?",75,170,70,20) $pc = IniReadSectionNames($db) for $i=1 to $pc[0] Step 1 TrayTip ( "Finding Hosts","Now Pinging " & $pc[$i] & "...",3,1) $pingres=Ping ($pc[$i],2500) IniWrite ($db,$pc[$i],"Ping",$pingres) $item[$i]=GUICtrlCreateListViewItem($pc[$i] & "|" & $pingres & "|col23",$listview) next $input1=GUICtrlCreateInput("",20,200, 150) GUICtrlSetState(-1,$GUI_ACCEPTFILES) ; to allow drag and dropping GUISetState() GUICtrlSetData($item2,"ITEM1",) GUICtrlSetData($item3,"||COL33",) GUICtrlDelete($item1) Do $msg = GUIGetMsg () Select Case $msg = $button MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2) Case $msg = $listview MsgBox(0,"listview", "clicked="& GUICtrlGetState($listview),2) EndSelect Until $msg = $GUI_EVENT_CLOSE Link to comment Share on other sites More sharing options...
greenmachine Posted March 16, 2006 Share Posted March 16, 2006 Here's what I got: WARNING: $item possibly not declared/created yet $item[$i]=GUICtrlCreateListViewItem($pc[$i] & "|" & $pingres & "|col23",$listview) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ WARNING: $item2: possibly used before declaration. GUICtrlSetData($item2, ~~~~~~~~~~~~~~~~~^ ERROR: syntax error GUICtrlSetData($item2,"ITEM1",) ~~~~~~~~~~~~~~~~~~~~~~~~^ WARNING: $item3: possibly used before declaration. GUICtrlSetData($item3, ~~~~~~~~~~~~~~~~~^ ERROR: syntax error GUICtrlSetData($item3,"||COL33",) ~~~~~~~~~~~~~~~~~~~~~~~~~^ WARNING: $item1: possibly used before declaration. GUICtrlDelete($item1) ~~~~~~~~~~~~~~~^ ERROR: $item2: undeclared global variable. GUICtrlSetData($item2, ~~~~~~~~~~~~~~~~~^ Link to comment Share on other sites More sharing options...
Valuater Posted March 16, 2006 Share Posted March 16, 2006 better... not tested expandcollapse popup#include <GUIConstants.au3> $db=@ScriptDir & "\Management.ini" GUICreate("listview items",220,250, 100,200,-1,$WS_EX_ACCEPTFILES) GUISetBkColor (0x00E0FFFF); will change background color $listview = GUICtrlCreateListView ("HostName|Ping Status|col3 ",10,10,200,150);,$LVS_SORTDESCENDING) $button = GUICtrlCreateButton ("Value?",75,170,70,20) $pc = IniReadSectionNames($db) Dim $item[$pc[0]] for $i=1 to $pc[0] Step 1 TrayTip ( "Finding Hosts","Now Pinging " & $pc[$i] & "...",3,1) $pingres=Ping ($pc[$i],2500) IniWrite ($db,$pc[$i],"Ping",$pingres) $item[$i]=GUICtrlCreateListViewItem($pc[$i] & "|" & $pingres & "|col23",$listview) next $input1=GUICtrlCreateInput("",20,200, 150) GUICtrlSetState(-1,$GUI_ACCEPTFILES) ; to allow drag and dropping GUISetState() GUICtrlSetData($item[2],"ITEM1") GUICtrlSetData($item[3],"||COL33") GUICtrlDelete($item[1]) Do $msg = GUIGetMsg () Select Case $msg = $button MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2) Case $msg = $listview MsgBox(0,"listview", "clicked="& GUICtrlGetState($listview),2) EndSelect Until $msg = $GUI_EVENT_CLOSE 8) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now