Kenzo2011 Posted September 30, 2011 Posted September 30, 2011 (edited) Hi all, This is my code. #include <GuiConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("Gui", 400, 306, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Button_1 = GUICtrlCreateButton("List Processes", 280, 160, 100, 20) $Button_2 = GUICtrlCreateButton("Kill Process", 280, 180, 100, 20) $button_3 = GUICtrlCreateButton("Show IP", 280, 120, 100, 20) $List_processes = GUICtrlCreateList("", 30, 20, 200, 260) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 $list = ProcessList() For $i = 1 To $list[0][0] GUICtrlSetData($List_processes, $list[$i][0]) Next Case $msg = $Button_2 ProcessClose(GUICtrlRead($List_processes)) Case $msg = $button_3 $ip = "IP address is :" &@TAB & @IPAddress1 GUICtrlSetData($List_processes, $ip) EndSelect WEnd Exit It worked well. But I have problems when I press 'List process' button and 'Show IP' button together. First : When I press 'List process' button it will show all information about processes in GUICtrlCreateList. And finally : I press 'Show IP' button, it show all information about processes and IP address. Pls, help me how to press 'Show IP' button. It only show IP information . Edited September 30, 2011 by Kenzo2011
JohnOne Posted September 30, 2011 Posted September 30, 2011 #include <GuiConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("Gui", 400, 306, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Button_1 = GUICtrlCreateButton("List Processes", 280, 160, 100, 20) $Button_2 = GUICtrlCreateButton("Kill Process", 280, 180, 100, 20) $button_3 = GUICtrlCreateButton("Show IP", 280, 120, 100, 20) $List_processes = GUICtrlCreateList("", 30, 20, 200, 260) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 GUICtrlSetData($List_processes, "") ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $list = ProcessList() For $i = 1 To $list[0][0] GUICtrlSetData($List_processes, $list[$i][0]) Next Case $msg = $Button_2 ProcessClose(GUICtrlRead($List_processes)) Case $msg = $button_3 $ip = "IP address is :" &@TAB & @IPAddress1 GUICtrlSetData($List_processes, "") ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlSetData($List_processes, $ip) EndSelect WEnd Exit AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Kenzo2011 Posted September 30, 2011 Author Posted September 30, 2011 (edited) Got it to work now, thanks for the quick answer JonhOne ! Edited September 30, 2011 by Kenzo2011
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