Jump to content

Ping Checker! :D


Info
 Share

Recommended Posts

#include <GUIConstants.au3>
#include <WindowsConstants.au3>

$MainGUI = GUICreate("Info's Ping Checker", 178, 93, -1, -1, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
;inputs
$WebsiteAddressInput = GUICtrlCreateInput("", 8, 28, 150, 21)
;labels
$WebsiteRadio = GUICtrlCreateLabel("Insert website \ IP address...", 8, 8, 250, 17)
$StatusLabel = GUICtrlCreateLabel("", 97, 66, 80, 80)
GUICtrlSetData ( $StatusLabel, "Waiting...")
GUICtrlSetColor ( $StatusLabel, 0xFF0000)
;button
$PingButton = GUICtrlCreateButton("Check My Ping", 8, 60, 81, 25, 0)
;set state
GUISetState(@SW_SHOW)

While 1
    $m = GUIGetMsg()
    Switch $m
        Case $GUI_EVENT_CLOSE
            Exit
        Case $PingButton
            GUICtrlSetData ( $StatusLabel, "Checking Ping...")
            GUICtrlSetColor ( $StatusLabel, 0x31D907)
            $PinCheckWebsite = Ping ( GUICtrlRead ( $WebsiteAddressInput))
            GUICtrlSetData ( $StatusLabel, "Ping is : " & $PinCheckWebsite)
            If $PinCheckWebsite = 0 Then
                GUICtrlSetData ( $StatusLabel, "Invalid Address!")
                GUICtrlSetColor ( $StatusLabel, 0xFF0000)
            EndIf
            If GUICtrlRead ( $WebsiteAddressInput) = "" Then
                GUICtrlSetData ( $StatusLabel, "Insert Address!")
                GUICtrlSetColor ( $StatusLabel, 0xFF0000)
            EndIf
    EndSwitch
WEnd

Edited by Info
Link to comment
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
 Share

  • Recently Browsing   0 members

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