
Outtext.Text = "" ' outtext is set to blank Sock.SendData a ' send data (a) above which is the messageĬhat.AddItem " " ' additem to the chat box/window Outtext.Text = old ' sets the last message in the message box MsgBox "Name successfully changed, saved. Print #1, nick.Text ' save the nick.text to the.

Open "C:\GeekSpotServer.nfo" For Output As #1 ' open. Sock.Listen ' listens for connections using winsock (called sock)

Sock.LocalPort = b ' gets the port input from (B) above Sock.Close ' close the winsock connectionī = InputBox("Enter Port of the server", "Connection settings") ' displays input box for the port to use Hip.Caption = "0.0.0.0" ' the hip caption is set to 9Ī = "User has disconected from chat" ' a = user disconnected Label2.Caption = "No one is connected" ' sets the label2 as no one is connected If chat.ListCount = 25 Then ' if the chat box gets full thenĪ = InputBox("Enter a note", "Note") ' inputbox will popup for add itemĬhat.AddItem a ' add item (a) which is the input box Sock.SendData a ' sending a (above) as data SendDataĬhat.AddItem " " & outtext.Text ' The chat window will add the item nick.text and the text message (outtext.text) Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer ' keystate (vbKeyReturn) simiulates the enter key, for pressing enter to send messageĪ = " " & outtext.Text ' defining what a is, nick.text and outtext(text message)

Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long ' sound Public old As String ' old as string (old is last msg) ' Special thanks to Steven Dorman, Rob Carr and my GF! This tutorial is how to make a CHAT APPLICATION - CLIENT + SERVER
