Jump to content
Sign in to follow this  
Kenzo2011

Hepl me how to solve the problem ?

Recommended Posts

Kenzo2011

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

Share this post


Link to post
Share on other sites
JohnOne

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

Share this post


Link to post
Share on other sites
Kenzo2011
Got it to work now, thanks for the quick answer JonhOne ! Edited by Kenzo2011

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  

×