Mosquitos Posted June 4, 2005 Posted June 4, 2005 I changes the code from burrup a little bit but the script closed immediately. I don't now what i do wrong.Can someone help please? expandcollapse popup#include <GUIConstants.au3> #include <Process.au3> Opt("OnExitFunc","_exit") Opt("GuiOnEventMode",1) Fileinstall("C:\Send.bmp",@tempdir&"\Send.bmp") _RunDos("net view" & " > " & @TempDir & "\temp.txt") $hello = FileOpen(@TempDir & "\temp.txt", 0) GUICreate("Network Chat", 350, 145) $computer = GUICtrlCreateList ("",10,25,130,125) GUISetBkColor(0x000000, $computer) While 1 $line = FileReadLine($hello) If @error = -1 Then ExitLoop If StringInStr($line, "\\") Then GUICtrlSetData($computer,StringMid( (StringStripWS($line, 8)), 3)) EndIf Wend FileClose($hello) GUICtrlCreateLabel ("Select the computer:", 25, 5, 120, 15) GUICtrlSetColor(-1,0xffff00) GUICtrlCreateLabel ("Please enter your message:", 180, 5, 130, 15) GUICtrlSetColor(-1,0xffff00) $msg1 = GUICtrlCreateInput ("", 150, 25, 190, 80) $send = GUICtrlCreatePic (@tempdir&"\Send.bmp", 195, 115, 100, 20) GuiSetState() GUISetOnEvent($GUI_EVENT_CLOSE,"_Exit") GuiCtrlSetOnEvent($send,"_send") WinSetTrans($computer, "", 200) Func _send() _RunDos("net send " & GUICtrlRead($computer) & " " & GUICtrlRead($msg1)) EndFunc Func _Exit() FileDelete(@TempDir & "\temp.txt") FileDelete(@TempDir & "\Send.bmp") Exit EndFunc Sapiente vince, rex, noli vincere ferro!
DaleHohm Posted June 4, 2005 Posted June 4, 2005 Please don't make me work so hard to try to help you... Please explain what you're trying to do, what isn't working and what you've tried to do to fix it... Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
Mosquitos Posted June 4, 2005 Author Posted June 4, 2005 (edited) I changed the look with colors and a bmpfile.Autoit gives no errors but if i run the script he closed immediately.This is the code from burrup...expandcollapse popup#include <Process.au3>#include <GUIConstants.au3>_RunDos("net view /domain" & " > " & @TempDir & "\temp.txt")$hello = FileOpen(@TempDir & "\temp.txt", 0)GUICreate("Network Chat", 300, 135)$computer = GUICtrlCreateList ("", 5,40,121,97)While 1 $line = FileReadLine($hello) If @error = -1 Then ExitLoop GUICtrlSetData(-1,$line)WendFileClose($hello)FileDelete(@TempDir & "\temp.txt")GUICtrlCreateLabel ("Select the computer to send your message to.", 5, 5, 150, 30)$msg1 = GUICtrlCreateInput ("", 135, 104, 156, 20)$send = GUICtrlCreateButton ("Send", 135, 75, 50)GuiSetState()While 1 $msg = GUIGetMsg() if $msg = $send then _RunDos("net send " & GUICtrlRead($computer) & " " & GUICtrlRead($msg1)) endif If $msg = $GUI_EVENT_CLOSE Then ExitLoopWend[code=auto:0] Edited June 4, 2005 by Mosquitos Sapiente vince, rex, noli vincere ferro! DaleHohm Posted June 4, 2005 DaleHohm MVPs 5.9k 11 Think of IE as an API... Posted June 4, 2005 (edited) You didn't include the Idle loop that was in burrup's code. Yours creates the GUI and simply falls through and exits. either addWhile 1 Sleep(100) Wend or burrup's code:While 1 $msg = GUIGetMsg() if $msg = $send then _RunDos("net send " & GUICtrlRead($computer) & " " & GUICtrlRead($msg1)) endif If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Dale Edited June 4, 2005 by DaleHohm Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
buzz44 Posted June 5, 2005 Posted June 5, 2005 Cool lol. I wrote that script ages ago for school so we could chat over the network and didn't have to open up CMD and type 'net send blah blah' each time. Glad its helping someone, or being put to use . qq
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