Advertisement
Guest User

Client

a guest
Mar 16th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.99 KB | None | 0 0
  1. #include <ButtonConstants.au3>
  2. #include <EditConstants.au3>
  3. #include <GUIConstantsEx.au3>
  4. #include <WindowsConstants.au3>
  5. #Region ### START Koda GUI section ### Form=
  6. $Form1 = GUICreate("VChat", 616, 438, 192, 124)
  7. $Input1 = GUICtrlCreateInput("", 8, 8, 513, 25)
  8. $Button1 = GUICtrlCreateButton("Send", 528, 8, 75, 25, $BS_DEFPUSHBUTTON)
  9. $Edit1 = GUICtrlCreateEdit("", 8, 40, 593, 385, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_VSCROLL))
  10. GUICtrlSetData(-1, "")
  11. GUISetState(@SW_SHOW)
  12. #EndRegion ### END Koda GUI section ###
  13.  
  14. TCPStartup()
  15.  
  16. Func sendData()
  17.     Local $TCPConnect = TCPConnect(@IPAddress1, 80)
  18.     If $TCPConnect = -1 Then MsgBox(0, "Error", @error)
  19.     Global $TCPSend = TCPSend($TCPConnect, GUICtrlRead($Input1))
  20.     GUICtrlSetData($Edit1, GUICtrlRead($Edit1) & GUICtrlRead($Input1) & @CRLF)
  21.     GUICtrlSetData($Input1, "")
  22. EndFunc
  23.  
  24. While 1
  25.     $nMsg = GUIGetMsg()
  26.     Switch $nMsg
  27.         Case $GUI_EVENT_CLOSE
  28.             Exit
  29.         Case $Button1
  30.             sendData()
  31.     EndSwitch
  32. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement