Jump to content

Recommended Posts

Posted (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 .

post-67422-0-29381900-1317378310_thumb.j

Edited by Kenzo2011
Posted

#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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...