Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Network Scanner Help

$
0
0
I'm trying to create a network scanner and I was curious, can an If statement be used to change the color of a Graphic object?

This is where my mind goes for the logic, but I guess what I'm missing is creating a variable for the graphic and how to change the color of that variable after a return.

Don't laugh, I'm a complete Novice, but here is my code so far:

[ autoit ]         
#include Opt("GUIOnEventMode", 1) $mainwindow = GUICreate( "WurmSoft Scanner", 600, 400) $scanButton = GUICtrlCreateButton( "Scan", 20, 20) $ipRange = GUICtrlCreateInput( "", 60, 20, 150) GUICtrlSetOnEvent( $scanButton, "ScanNetwork") ;Devices starts here GUICtrlCreateLabel( ".155", 20, 60) $hGraphic = GUICtrlCreateGraphic( 55, 60, 10, 10) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x666666, 0x999999) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 1, 10, 10) GUISetOnEvent($GUI_EVENT_CLOSE, "closeClicked") GUISetState(@SW_SHOW) Func ScanNetwork() $subnet = GUICtrlRead( $ipRange) $pingReturn = Ping( $subnet & ".155") If $pingReturn Then GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x666666, 0x00ff00) EndIf EndFunc Func closeClicked() Exit EndFunc While 1 Sleep(1000) WEnd

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>