setengahgila Posted July 5, 2013 Share Posted July 5, 2013 somebody help me.. i cant created project with local ip monitor.. here my example script #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 321, 59, 192, 124) $Label1 = GUICtrlCreateLabel("Your IP :", 16, 16, 84, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel(@IPAddress1, 104, 16, 130, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd My problem.. when i am disconnect modem GUI not auto set to 127.0.0.1 i am must close and run gui again for update status my network.. thanks before for help.. sorry my english speak is very bad.. Link to comment Share on other sites More sharing options...
TheSaint Posted July 5, 2013 Share Posted July 5, 2013 (edited) somebody help me.. i cant created project with local ip monitor.. You need to implement a query inside your While ... Wend loop (probably involving a timed check after a specified duration) or maybe even just use a button. Here's a simple implementation without timing. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 321, 59, 192, 124) $Label1 = GUICtrlCreateLabel("Your IP :", 16, 16, 84, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel(@IPAddress1, 104, 16, 130, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $lastip = @IPAddress1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch If $lastip <> @IPAddress1 Then $lastip = @IPAddress1 GuiCtrlSetData($Label2, $lastip) EndIf WEnd That's better, copied properly by copying from a quoted version of code ... anyway I digress. Not sure what constantly checking a Macro does for memory use, but personally I'd either go Timed (TimerInit and TimerDiff) or use a Button. Edited July 5, 2013 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
setengahgila Posted July 5, 2013 Author Share Posted July 5, 2013 Thank's TheSaint This Script Work Prfectly... Link to comment Share on other sites More sharing options...
scubar Posted July 5, 2013 Share Posted July 5, 2013 how do you know @IPAddress1 will be the correct IP ? What if they have multiple network adaptors. Link to comment Share on other sites More sharing options...
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