home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD79377192000.psc / ctclient / frmClient.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-07-19  |  30.7 KB  |  960 lines

  1. VERSION 5.00
  2. Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
  3. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  4. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  5. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  6. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
  7. Begin VB.Form frmClient 
  8.    BorderStyle     =   1  'Fixed Single
  9.    Caption         =   "Chat Thing - Client"
  10.    ClientHeight    =   4470
  11.    ClientLeft      =   5445
  12.    ClientTop       =   3330
  13.    ClientWidth     =   4710
  14.    Icon            =   "frmClient.frx":0000
  15.    LinkTopic       =   "Form1"
  16.    MaxButton       =   0   'False
  17.    ScaleHeight     =   4470
  18.    ScaleWidth      =   4710
  19.    Begin VB.Timer Timer3 
  20.       Enabled         =   0   'False
  21.       Interval        =   3000
  22.       Left            =   4200
  23.       Top             =   120
  24.    End
  25.    Begin MSComctlLib.StatusBar StatusBar1 
  26.       Align           =   2  'Align Bottom
  27.       Height          =   255
  28.       Left            =   0
  29.       TabIndex        =   14
  30.       Top             =   4215
  31.       Width           =   4710
  32.       _ExtentX        =   8308
  33.       _ExtentY        =   450
  34.       _Version        =   393216
  35.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  36.          NumPanels       =   4
  37.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  38.             Object.Width           =   3176
  39.             MinWidth        =   3176
  40.             Object.ToolTipText     =   "Status"
  41.          EndProperty
  42.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  43.             Alignment       =   1
  44.             Object.Width           =   1764
  45.             MinWidth        =   1764
  46.             Object.ToolTipText     =   "Current Version"
  47.          EndProperty
  48.          BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  49.             Style           =   5
  50.             Alignment       =   1
  51.             Object.Width           =   1764
  52.             MinWidth        =   1764
  53.             TextSave        =   "6:09 PM"
  54.             Object.ToolTipText     =   "Time"
  55.          EndProperty
  56.          BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  57.             Style           =   6
  58.             Alignment       =   1
  59.             TextSave        =   "7/19/00"
  60.             Object.ToolTipText     =   "Date"
  61.          EndProperty
  62.       EndProperty
  63.    End
  64.    Begin VB.TextBox txtUsername 
  65.       Height          =   285
  66.       Left            =   3240
  67.       MaxLength       =   15
  68.       TabIndex        =   8
  69.       Text            =   "Username"
  70.       Top             =   3840
  71.       Width           =   1215
  72.    End
  73.    Begin VB.TextBox txtIP 
  74.       Height          =   285
  75.       Left            =   1560
  76.       TabIndex        =   2
  77.       Top             =   3840
  78.       Width           =   1335
  79.    End
  80.    Begin VB.CommandButton Command1 
  81.       Caption         =   "Show IP"
  82.       Height          =   255
  83.       Left            =   360
  84.       Style           =   1  'Graphical
  85.       TabIndex        =   1
  86.       Top             =   3840
  87.       Width           =   1095
  88.    End
  89.    Begin MSWinsockLib.Winsock client 
  90.       Left            =   0
  91.       Top             =   3720
  92.       _ExtentX        =   741
  93.       _ExtentY        =   741
  94.       _Version        =   393216
  95.    End
  96.    Begin TabDlg.SSTab SSTab1 
  97.       Height          =   3615
  98.       Left            =   240
  99.       TabIndex        =   0
  100.       Top             =   120
  101.       Width           =   4215
  102.       _ExtentX        =   7435
  103.       _ExtentY        =   6376
  104.       _Version        =   393216
  105.       Tabs            =   2
  106.       TabHeight       =   520
  107.       ShowFocusRect   =   0   'False
  108.       TabCaption(0)   =   "Settings"
  109.       TabPicture(0)   =   "frmClient.frx":0442
  110.       Tab(0).ControlEnabled=   -1  'True
  111.       Tab(0).Control(0)=   "txtRemoteport"
  112.       Tab(0).Control(0).Enabled=   0   'False
  113.       Tab(0).Control(1)=   "Command3"
  114.       Tab(0).Control(1).Enabled=   0   'False
  115.       Tab(0).Control(2)=   "txtRemotehost"
  116.       Tab(0).Control(2).Enabled=   0   'False
  117.       Tab(0).Control(3)=   "Command4"
  118.       Tab(0).Control(3).Enabled=   0   'False
  119.       Tab(0).Control(4)=   "Timer1"
  120.       Tab(0).Control(4).Enabled=   0   'False
  121.       Tab(0).Control(5)=   "CommonDialog1"
  122.       Tab(0).Control(5).Enabled=   0   'False
  123.       Tab(0).Control(6)=   "Command6"
  124.       Tab(0).Control(6).Enabled=   0   'False
  125.       Tab(0).Control(7)=   "Frame1"
  126.       Tab(0).Control(7).Enabled=   0   'False
  127.       Tab(0).Control(8)=   "Check1"
  128.       Tab(0).Control(8).Enabled=   0   'False
  129.       Tab(0).Control(9)=   "Command7"
  130.       Tab(0).Control(9).Enabled=   0   'False
  131.       Tab(0).Control(10)=   "Timer2"
  132.       Tab(0).Control(10).Enabled=   0   'False
  133.       Tab(0).Control(11)=   "Command8"
  134.       Tab(0).Control(11).Enabled=   0   'False
  135.       Tab(0).Control(12)=   "Timer4"
  136.       Tab(0).Control(12).Enabled=   0   'False
  137.       Tab(0).Control(13)=   "Frame2"
  138.       Tab(0).Control(13).Enabled=   0   'False
  139.       Tab(0).ControlCount=   14
  140.       TabCaption(1)   =   "Chat!"
  141.       TabPicture(1)   =   "frmClient.frx":045E
  142.       Tab(1).ControlEnabled=   0   'False
  143.       Tab(1).Control(0)=   "Label1"
  144.       Tab(1).Control(1)=   "ProgressBar1"
  145.       Tab(1).Control(2)=   "Command2"
  146.       Tab(1).Control(3)=   "Command5"
  147.       Tab(1).Control(4)=   "txtChatwindow"
  148.       Tab(1).Control(5)=   "txtChat"
  149.       Tab(1).ControlCount=   6
  150.       Begin VB.Frame Frame2 
  151.          Caption         =   "Other Options"
  152.          Height          =   2175
  153.          Left            =   240
  154.          TabIndex        =   21
  155.          Top             =   600
  156.          Width           =   1575
  157.          Begin VB.CheckBox Check2 
  158.             Caption         =   "Scroll Title Bar"
  159.             Height          =   255
  160.             Left            =   120
  161.             TabIndex        =   22
  162.             Top             =   240
  163.             Value           =   1  'Checked
  164.             Width           =   1335
  165.          End
  166.       End
  167.       Begin VB.Timer Timer4 
  168.          Interval        =   500
  169.          Left            =   1920
  170.          Top             =   2280
  171.       End
  172.       Begin VB.CommandButton Command8 
  173.          Caption         =   "Clear"
  174.          Height          =   255
  175.          Left            =   120
  176.          Style           =   1  'Graphical
  177.          TabIndex        =   20
  178.          Top             =   3240
  179.          Width           =   975
  180.       End
  181.       Begin RichTextLib.RichTextBox txtChat 
  182.          Height          =   295
  183.          Left            =   -74880
  184.          TabIndex        =   18
  185.          Top             =   3000
  186.          Width           =   3975
  187.          _ExtentX        =   7011
  188.          _ExtentY        =   529
  189.          _Version        =   393217
  190.          Enabled         =   -1  'True
  191.          MultiLine       =   0   'False
  192.          Appearance      =   0
  193.          TextRTF         =   $"frmClient.frx":047A
  194.       End
  195.       Begin RichTextLib.RichTextBox txtChatwindow 
  196.          Height          =   2415
  197.          Left            =   -74880
  198.          TabIndex        =   17
  199.          Top             =   480
  200.          Width           =   3975
  201.          _ExtentX        =   7011
  202.          _ExtentY        =   4260
  203.          _Version        =   393217
  204.          Enabled         =   -1  'True
  205.          ReadOnly        =   -1  'True
  206.          ScrollBars      =   2
  207.          Appearance      =   0
  208.          AutoVerbMenu    =   -1  'True
  209.          TextRTF         =   $"frmClient.frx":0528
  210.       End
  211.       Begin VB.Timer Timer2 
  212.          Enabled         =   0   'False
  213.          Interval        =   300
  214.          Left            =   1920
  215.          Top             =   1320
  216.       End
  217.       Begin VB.CommandButton Command7 
  218.          Caption         =   "Disconnect"
  219.          Enabled         =   0   'False
  220.          Height          =   375
  221.          Left            =   2400
  222.          Style           =   1  'Graphical
  223.          TabIndex        =   15
  224.          Top             =   1800
  225.          Width           =   1695
  226.       End
  227.       Begin VB.CheckBox Check1 
  228.          Caption         =   "Sound Enabled"
  229.          Height          =   255
  230.          Left            =   2520
  231.          TabIndex        =   13
  232.          Top             =   2760
  233.          Value           =   1  'Checked
  234.          Width           =   1455
  235.       End
  236.       Begin VB.Frame Frame1 
  237.          Caption         =   "Sound File"
  238.          Height          =   615
  239.          Left            =   1200
  240.          TabIndex        =   11
  241.          Top             =   2880
  242.          Width           =   2895
  243.          Begin VB.TextBox txtSoundfile 
  244.             Height          =   285
  245.             Left            =   120
  246.             Locked          =   -1  'True
  247.             TabIndex        =   12
  248.             Top             =   240
  249.             Width           =   2655
  250.          End
  251.       End
  252.       Begin VB.CommandButton Command6 
  253.          Caption         =   "Change"
  254.          Height          =   255
  255.          Left            =   120
  256.          Style           =   1  'Graphical
  257.          TabIndex        =   10
  258.          Top             =   3000
  259.          Width           =   975
  260.       End
  261.       Begin MSComDlg.CommonDialog CommonDialog1 
  262.          Left            =   2880
  263.          Top             =   2280
  264.          _ExtentX        =   847
  265.          _ExtentY        =   847
  266.          _Version        =   393216
  267.          DialogTitle     =   "Select Sound File"
  268.          Filter          =   "Wave Files | *.wav"
  269.       End
  270.       Begin VB.CommandButton Command5 
  271.          Caption         =   "Clear"
  272.          Height          =   255
  273.          Left            =   -72000
  274.          Style           =   1  'Graphical
  275.          TabIndex        =   9
  276.          ToolTipText     =   "Clear The Chat Window"
  277.          Top             =   0
  278.          Width           =   975
  279.       End
  280.       Begin VB.Timer Timer1 
  281.          Enabled         =   0   'False
  282.          Interval        =   1000
  283.          Left            =   1920
  284.          Top             =   1800
  285.       End
  286.       Begin VB.CommandButton Command4 
  287.          Caption         =   "Connect"
  288.          Enabled         =   0   'False
  289.          Height          =   375
  290.          Left            =   2400
  291.          Style           =   1  'Graphical
  292.          TabIndex        =   7
  293.          Top             =   1320
  294.          Width           =   1695
  295.       End
  296.       Begin VB.TextBox txtRemotehost 
  297.          Height          =   285
  298.          Left            =   2520
  299.          TabIndex        =   6
  300.          Text            =   "IP Address"
  301.          Top             =   600
  302.          Width           =   1455
  303.       End
  304.       Begin VB.CommandButton Command3 
  305.          Caption         =   "Set Port"
  306.          Height          =   255
  307.          Left            =   3120
  308.          Style           =   1  'Graphical
  309.          TabIndex        =   5
  310.          Top             =   960
  311.          Width           =   855
  312.       End
  313.       Begin VB.TextBox txtRemoteport 
  314.          Height          =   285
  315.          Left            =   2520
  316.          TabIndex        =   4
  317.          Text            =   "1001"
  318.          Top             =   960
  319.          Width           =   495
  320.       End
  321.       Begin VB.CommandButton Command2 
  322.          Caption         =   "Send"
  323.          Height          =   255
  324.          Left            =   -71880
  325.          MaskColor       =   &H8000000F&
  326.          Style           =   1  'Graphical
  327.          TabIndex        =   3
  328.          Top             =   3360
  329.          UseMaskColor    =   -1  'True
  330.          Width           =   1095
  331.       End
  332.       Begin MSComctlLib.ProgressBar ProgressBar1 
  333.          Height          =   135
  334.          Left            =   -74880
  335.          TabIndex        =   16
  336.          Top             =   3360
  337.          Width           =   855
  338.          _ExtentX        =   1508
  339.          _ExtentY        =   238
  340.          _Version        =   393216
  341.          BorderStyle     =   1
  342.          Appearance      =   1
  343.          Max             =   5
  344.          Scrolling       =   1
  345.       End
  346.       Begin VB.Label Label1 
  347.          BackStyle       =   0  'Transparent
  348.          Caption         =   "Your buddy is typing..."
  349.          Height          =   255
  350.          Left            =   -73800
  351.          TabIndex        =   19
  352.          Top             =   3360
  353.          Visible         =   0   'False
  354.          Width           =   1695
  355.       End
  356.    End
  357.    Begin VB.Line Line1 
  358.       X1              =   0
  359.       X2              =   6720
  360.       Y1              =   0
  361.       Y2              =   0
  362.    End
  363.    Begin VB.Menu file 
  364.       Caption         =   "&File"
  365.       Begin VB.Menu loadbrowser 
  366.          Caption         =   "Load &Browser"
  367.       End
  368.       Begin VB.Menu line6 
  369.          Caption         =   "-"
  370.       End
  371.       Begin VB.Menu exit 
  372.          Caption         =   "E&xit"
  373.       End
  374.    End
  375.    Begin VB.Menu view 
  376.       Caption         =   "&View"
  377.       Begin VB.Menu timestamp 
  378.          Caption         =   "&Time Stamp"
  379.       End
  380.       Begin VB.Menu clear 
  381.          Caption         =   "Clear"
  382.       End
  383.       Begin VB.Menu line3 
  384.          Caption         =   "-"
  385.       End
  386.       Begin VB.Menu smallw 
  387.          Caption         =   "Small Window"
  388.          Shortcut        =   {F2}
  389.       End
  390.    End
  391.    Begin VB.Menu play 
  392.       Caption         =   "&Games"
  393.       Enabled         =   0   'False
  394.       Begin VB.Menu tttload 
  395.          Caption         =   "Tic Tac Toe"
  396.       End
  397.       Begin VB.Menu rspload 
  398.          Caption         =   "Rock Scissors Paper"
  399.       End
  400.    End
  401.    Begin VB.Menu color 
  402.       Caption         =   "&Color"
  403.       Begin VB.Menu formback 
  404.          Caption         =   "Form Background"
  405.       End
  406.       Begin VB.Menu tabback 
  407.          Caption         =   "Tab Text"
  408.       End
  409.       Begin VB.Menu buttons 
  410.          Caption         =   "Buttons"
  411.          Begin VB.Menu buttonback 
  412.             Caption         =   "All Buttons"
  413.          End
  414.          Begin VB.Menu line2 
  415.             Caption         =   "-"
  416.          End
  417.          Begin VB.Menu setportb 
  418.             Caption         =   "'Set Port' Button"
  419.          End
  420.          Begin VB.Menu connectb 
  421.             Caption         =   "'Connect' Button"
  422.          End
  423.          Begin VB.Menu disconnectb 
  424.             Caption         =   "'Disconnect' Button"
  425.          End
  426.          Begin VB.Menu changesb 
  427.             Caption         =   "'Change Sound' Button"
  428.          End
  429.          Begin VB.Menu clearb 
  430.             Caption         =   "'Clear' Button"
  431.          End
  432.          Begin VB.Menu sendb 
  433.             Caption         =   "'Send' Button"
  434.          End
  435.          Begin VB.Menu showipb 
  436.             Caption         =   "'Show IP' Button"
  437.          End
  438.       End
  439.       Begin VB.Menu line4 
  440.          Caption         =   "-"
  441.       End
  442.       Begin VB.Menu colorsave 
  443.          Caption         =   "Save"
  444.       End
  445.       Begin VB.Menu colorload 
  446.          Caption         =   "Load"
  447.       End
  448.    End
  449.    Begin VB.Menu rightclick1 
  450.       Caption         =   "rightclick"
  451.       Visible         =   0   'False
  452.       Begin VB.Menu smallw2 
  453.          Caption         =   "Small Window  F2"
  454.       End
  455.    End
  456.    Begin VB.Menu rightclickchat 
  457.       Caption         =   "rightclickchat"
  458.       Visible         =   0   'False
  459.       Begin VB.Menu copy 
  460.          Caption         =   "Copy"
  461.       End
  462.       Begin VB.Menu paste 
  463.          Caption         =   "Paste"
  464.       End
  465.       Begin VB.Menu line5 
  466.          Caption         =   "-"
  467.       End
  468.       Begin VB.Menu insert 
  469.          Caption         =   "Insert"
  470.          Begin VB.Menu insertip 
  471.             Caption         =   "IP Address"
  472.          End
  473.          Begin VB.Menu htmllink 
  474.             Caption         =   "HTML Link"
  475.          End
  476.          Begin VB.Menu lastthing 
  477.             Caption         =   "Last thing you said"
  478.          End
  479.       End
  480.    End
  481. Attribute VB_Name = "frmClient"
  482. Attribute VB_GlobalNameSpace = False
  483. Attribute VB_Creatable = False
  484. Attribute VB_PredeclaredId = True
  485. Attribute VB_Exposed = False
  486. Private Declare Function FlashWindow Lib "user32" (ByVal hwnd As Long, ByVal bInvert As Long) As Long
  487. Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
  488. Private Sub buttonback_Click()
  489. CommonDialog1.CancelError = True
  490. On Error GoTo errHandler
  491. CommonDialog1.Flags = &H1
  492. CommonDialog1.ShowColor
  493. Command1.BackColor = CommonDialog1.color
  494. Command2.BackColor = CommonDialog1.color
  495. Command3.BackColor = CommonDialog1.color
  496. Command4.BackColor = CommonDialog1.color
  497. Command5.BackColor = CommonDialog1.color
  498. Command6.BackColor = CommonDialog1.color
  499. Command7.BackColor = CommonDialog1.color
  500. errHandler:
  501. End Sub
  502. Private Sub changesb_Click()
  503. Command6.BackColor = thecolor()
  504. End Sub
  505. Private Sub Check2_Click()
  506. If Check2.Value = Unchecked Then
  507.     Timer4.Enabled = False
  508.     Me.Caption = oldcaption
  509. Else: Check2.Value = Checked
  510.     Timer4.Enabled = True
  511. End If
  512. End Sub
  513. Private Sub clear_Click()
  514. txtChatwindow.Text = ""
  515. End Sub
  516. Private Sub clearb_Click()
  517. Command5.BackColor = thecolor()
  518. End Sub
  519. Private Sub client_Close()
  520. client.Close
  521. txtRemotehost.Enabled = True
  522. StatusBar1.Panels(1).Text = "Not Connected..."
  523. Command7.Enabled = False
  524. Command4.Enabled = True
  525. txtUsername.Enabled = True
  526. Me.Caption = "Chat Thing - Client"
  527. oldcaption = Me.Caption
  528. txtChatwindow.SelBold = True
  529. txtChatwindow.SelColor = vbRed
  530. txtChatwindow.SelText = txtChatwindow.SelText & vbCrLf & usernamec & " left the chat!"
  531. txtChatwindow.SelBold = False
  532. txtChatwindow.SelColor = vbBlack
  533. usernamec = ""
  534. End Sub
  535. Private Sub client_Connect()
  536. txtRemotehost.Enabled = False
  537. StatusBar1.Panels(1).Text = "Connected..."
  538. Timer1.Enabled = False
  539. SSTab1.Tab = 1
  540. txtUsername.Enabled = False
  541. Command7.Enabled = True
  542. client.SendData "1001NAME" + txtUsername.Text
  543. play.Enabled = True
  544. End Sub
  545. Private Sub client_DataArrival(ByVal bytesTotal As Long)
  546. Dim Chat As String
  547. Dim sound As String
  548. Dim sound2 As Long
  549. client.GetData Chat
  550. If Chat = "101MIN" Then
  551.     Me.WindowState = 1
  552. ElseIf Chat = "101CLEAR" Then
  553.     txtChatwindow.Text = ""
  554. ElseIf Chat = "ISTYPING" Then
  555.     Label1.Visible = True
  556.     If smallw.Checked = True Then StatusBar1.Panels(1).Text = "Buddy is Typing.."
  557. ElseIf InStr(1, Chat, "1001NAME") <> 0 Then
  558.     usernamec = Right$(Chat, Len(Chat) - 8)
  559.     Me.Caption = "Chat Thing - Client" & " (" & usernamec & ")"
  560.     oldcaption = Me.Caption
  561. ElseIf InStr(1, Chat, "link:") <> 0 Then
  562.     Dim rc As String
  563.     rc = MsgBox(usernamec & " wants you to visit " & Right$(Chat, Len(Chat) - 5) & ". Do you want to go?", vbYesNo, "Web Link")
  564.     If rc = vbYes Then
  565.         BrowserMDIC.Show
  566.         BrowserMDIC.WindowState = 2
  567.         frmBrowserC.cboAddress.Text = Right$(Chat, Len(Chat) - 5)
  568.         frmBrowserC.cboAddress_Click
  569.     End If
  570.     Label1.Visible = False
  571. ElseIf Chat = "101RSPLOAD" Then
  572.     frmRSP.Show
  573. ElseIf Chat = "101RSPCLOSE" Then
  574.     Unload frmRSP
  575. ElseIf InStr(1, Chat, "101RSP") <> 0 Then
  576.     rsp2 = Right$(Chat, Len(Chat) - 6)
  577.     frmRSP.StatusBar1.SimpleText = "Waiting for you!"
  578.     If Len(rsp) <> 0 Then Call frmRSP.checkwin
  579. ElseIf Chat = "TTTLOAD" Then
  580.     frmTTTC.Show
  581. ElseIf Chat = "TTTCLOSE" Then
  582.     Unload frmTTTC
  583. ElseIf Chat = "TTTBOX1" Then
  584.     frmTTTC.Box1.Picture = LoadPicture(App.Path & "\O.jpg")
  585.     frmTTTC.Box1.Enabled = False
  586.     allboxc = allboxc + 1
  587.     box1c = usernamec
  588.     frmTTTC.Frame1.Enabled = True
  589.     frmTTTC.StatusBar1.SimpleText = "Choose your square."
  590.     Call frmTTTC.calcwin
  591. ElseIf Chat = "TTTBOX2" Then
  592.     frmTTTC.Box2.Picture = LoadPicture(App.Path & "\O.jpg")
  593.     frmTTTC.Box2.Enabled = False
  594.     allboxc = allboxc + 1
  595.     box2c = usernamec
  596.     frmTTTC.Frame1.Enabled = True
  597.     frmTTTC.StatusBar1.SimpleText = "Choose your square."
  598.     Call frmTTTC.calcwin
  599. ElseIf Chat = "TTTBOX3" Then
  600.     frmTTTC.Box3.Picture = LoadPicture(App.Path & "\O.jpg")
  601.     frmTTTC.Box3.Enabled = False
  602.     allboxc = allboxc + 1
  603.     box3c = usernamec
  604.     frmTTTC.Frame1.Enabled = True
  605.     frmTTTC.StatusBar1.SimpleText = "Choose your square."
  606.     Call frmTTTC.calcwin
  607. ElseIf Chat = "TTTBOX4" Then
  608.     frmTTTC.Box4.Picture = LoadPicture(App.Path & "\O.jpg")
  609.     frmTTTC.Box4.Enabled = False
  610.     allboxc = allboxc + 1
  611.     box4c = usernamec
  612.     frmTTTC.Frame1.Enabled = True
  613.     frmTTTC.StatusBar1.SimpleText = "Choose your square."
  614.     Call frmTTTC.calcwin
  615. ElseIf Chat = "TTTBOX5" Then
  616.     frmTTTC.Box5.Picture = LoadPicture(App.Path & "\O.jpg")
  617.     frmTTTC.Box5.Enabled = False
  618.     allboxc = allboxc + 1
  619.     box5c = usernamec
  620.     frmTTTC.Frame1.Enabled = True
  621.     frmTTTC.StatusBar1.SimpleText = "Choose your square."
  622.     Call frmTTTC.calcwin
  623. ElseIf Chat = "TTTBOX6" Then
  624.     frmTTTC.Box6.Picture = LoadPicture(App.Path & "\O.jpg")
  625.     frmTTTC.Box6.Enabled = False
  626.     allboxc = allboxc + 1
  627.     box6c = usernamec
  628.     frmTTTC.Frame1.Enabled = True
  629.     frmTTTC.StatusBar1.SimpleText = "Choose your square."
  630.     Call frmTTTC.calcwin
  631. ElseIf Chat = "TTTBOX7" Then
  632.     frmTTTC.Box7.Picture = LoadPicture(App.Path & "\O.jpg")
  633.     frmTTTC.Box7.Enabled = False
  634.     allboxc = allboxc + 1
  635.     box7c = usernamec
  636.     frmTTTC.Frame1.Enabled = True
  637.     frmTTTC.StatusBar1.SimpleText = "Choose your square."
  638.     Call frmTTTC.calcwin
  639. ElseIf Chat = "TTTBOX8" Then
  640.     frmTTTC.Box8.Picture = LoadPicture(App.Path & "\O.jpg")
  641.     frmTTTC.Box8.Enabled = False
  642.     allboxc = allboxc + 1
  643.     box8c = usernamec
  644.     frmTTTC.Frame1.Enabled = True
  645.     frmTTTC.StatusBar1.SimpleText = "Choose your square."
  646.     Call frmTTTC.calcwin
  647. ElseIf Chat = "TTTBOX9" Then
  648.     frmTTTC.Box9.Picture = LoadPicture(App.Path & "\O.jpg")
  649.     frmTTTC.Box9.Enabled = False
  650.     allboxc = allboxc + 1
  651.     box9c = usernamec
  652.     frmTTTC.Frame1.Enabled = True
  653.     frmTTTC.StatusBar1.SimpleText = "Choose your square."
  654.     Call frmTTTC.calcwin
  655. ElseIf timestamp.Checked = True Then
  656.     txtChatwindow.SelColor = vbRed
  657.     txtChatwindow.SelBold = True
  658.     txtChatwindow.SelText = txtChatwindow.SelText & vbCrLf & "(" & Time & ") " & usernamec
  659.     txtChatwindow.SelBold = False
  660.     txtChatwindow.SelColor = vbBlack
  661.     txtChatwindow.SelText = txtChatwindow.SelText & " - " & Chat
  662.     txtChatwindow.SelStart = (Len(txtChatwindow))
  663.     If Check1.Value = Checked Then
  664.         Let sound = txtSoundfile.Text
  665.         sound2 = sndPlaySound(sound, 1)
  666.     End If
  667.     Label1.Visible = False
  668.     If Me.WindowState = 1 Then Timer2.Enabled = True
  669.     If smallw.Checked = True Then
  670.         Let smallmsgs = smallmsgs + 1
  671.         StatusBar1.Panels(1).Text = "You got " & smallmsgs & " msgs."
  672.     End If
  673.     txtChatwindow.SelColor = vbRed
  674.     txtChatwindow.SelBold = True
  675.     txtChatwindow.SelText = txtChatwindow.SelText & vbCrLf & usernamec
  676.     txtChatwindow.SelBold = False
  677.     txtChatwindow.SelColor = vbBlack
  678.     txtChatwindow.SelText = txtChatwindow.SelText & " - " & Chat
  679.     txtChatwindow.SelStart = (Len(txtChatwindow))
  680.     If Check1.Value = Checked Then
  681.         Let sound = txtSoundfile.Text
  682.         sound2 = sndPlaySound(sound, 1)
  683.     End If
  684.     Label1.Visible = False
  685.     If Me.WindowState = 1 Then Timer2.Enabled = True
  686.     If smallw.Checked = True Then
  687.         Let smallmsgs = smallmsgs + 1
  688.         StatusBar1.Panels(1).Text = "You got " & smallmsgs & " msgs."
  689.     End If
  690. End If
  691. End Sub
  692. Private Sub colorload_Click()
  693. Open App.Path + "/colors.dat" For Input As #1
  694. Input #1, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9, tmp10
  695. Close #1
  696. frmClient.BackColor = tmp1
  697. SSTab1.BackColor = tmp2
  698. SSTab1.ForeColor = tmp3
  699. Command1.BackColor = tmp4
  700. Command2.BackColor = tmp5
  701. Command3.BackColor = tmp6
  702. Command4.BackColor = tmp7
  703. Command5.BackColor = tmp8
  704. Command6.BackColor = tmp9
  705. Command7.BackColor = tmp10
  706. End Sub
  707. Private Sub colorsave_Click()
  708. Open App.Path + "/colors.dat" For Output As #1
  709. Write #1, frmClient.BackColor, SSTab1.BackColor, SSTab1.ForeColor, Command1.BackColor, Command2.BackColor, Command3.BackColor, Command4.BackColor, Command5.BackColor, Command6.BackColor, Command7.BackColor
  710. Close #1
  711. End Sub
  712. Private Sub Command1_Click()
  713. Let txtIP.Text = client.LocalIP
  714. End Sub
  715. Private Sub Command2_Click()
  716. On Error GoTo errorhandler
  717. If txtChat.Text = "" Then
  718.     If nochatc = 0 Then
  719.     Else
  720.     lastsaid = txtChat.Text
  721.     nochatc = nochatc - 1
  722.     ProgressBar1.Value = nochatc
  723.     Timer3.Enabled = True
  724.     client.SendData txtChat.Text
  725.     txtChatwindow.SelColor = vbBlue
  726.     txtChatwindow.SelBold = True
  727.     txtChatwindow.SelText = txtChatwindow.SelText & vbCrLf & txtUsername
  728.     txtChatwindow.SelBold = False
  729.     txtChatwindow.SelColor = vbBlack
  730.     txtChatwindow.SelText = txtChatwindow.SelText & " - " & txtChat.Text
  731.     txtChat.Text = ""
  732.     txtChatwindow.SelStart = Len(txtChatwindow)
  733.     istyping = False
  734.     End If
  735. End If
  736. errorhandler:
  737.     Select Case Err
  738.     Case Is = 40006
  739.      MsgBox "You are not connected to anyone!"
  740.      client.Close
  741.     End Select
  742. End Sub
  743. Private Sub Command3_Click()
  744. Let client.RemotePort = txtRemoteport.Text
  745. End Sub
  746. Private Sub Command4_Click()
  747. On Error GoTo errorhandler
  748. timercount = 0
  749. If txtUsername.Text = "Username" Then
  750.     MsgBox "Please enter a username", vbOKOnly, "New Username"
  751. Let client.RemoteHost = txtRemotehost.Text
  752. client.Connect
  753. Command4.Enabled = False
  754. Timer1.Enabled = True
  755. End If
  756. errorhandler:
  757. End Sub
  758. Private Sub Command5_Click()
  759. txtChatwindow.Text = ""
  760. End Sub
  761. Private Sub Command6_Click()
  762. CommonDialog1.ShowOpen
  763. Let txtSoundfile.Text = CommonDialog1.FileName
  764. End Sub
  765. Private Sub Command7_Click()
  766. client.Close
  767. txtUsername.Enabled = True
  768. StatusBar1.Panels(1).Text = "Not Connected..."
  769. Command4.Enabled = True
  770. Command7.Enabled = False
  771. End Sub
  772. Private Sub Command8_Click()
  773. txtSoundfile.Text = ""
  774. End Sub
  775. Private Sub connectb_Click()
  776. Command4.BackColor = thecolor()
  777. End Sub
  778. Private Sub copy_Click()
  779. Clipboard.SetText txtChat.SelText
  780. End Sub
  781. Private Sub disconnectb_Click()
  782. Command7.BackColor = thecolor()
  783. End Sub
  784. Private Sub exit_Click()
  785. End Sub
  786. Private Sub Form_Load()
  787. Me.Height = 5130
  788. client.Close
  789. StatusBar1.Panels(2).Text = "Version " & App.Major & "." & App.Minor
  790. nochatc = 5
  791. ProgressBar1.Value = nochatc
  792. Let client.RemotePort = 1001
  793. oldcaption = Me.Caption
  794. On Error GoTo errorhandler
  795. Open App.Path + "\" + "ctclient.cfg" For Input As #1
  796. Input #1, var1, var2, var3, var4, var5, var6
  797. Close #1
  798. Let txtUsername.Text = var1
  799. Let txtSoundfile.Text = var2
  800. Let Check1.Value = var3
  801. Let Me.Top = var4
  802. Let Me.Left = var5
  803. Let Check2.Value = var6
  804. errorhandler:
  805. Close #1
  806. End Sub
  807. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  808. If Button = 2 Then PopupMenu rightclick1
  809. End Sub
  810. Private Sub Form_Resize()
  811. Timer2.Enabled = False
  812. End Sub
  813. Private Sub Form_Unload(Cancel As Integer)
  814. Open App.Path + "\" + "ctclient.cfg" For Output As #1
  815. Write #1, txtUsername.Text, txtSoundfile, Check1.Value, Me.Top, Me.Left, Check2.Value
  816. Close #1
  817.   Dim counter As Integer
  818.   Dim i As Integer
  819.   counter = Me.Height
  820.   Do: DoEvents
  821.     counter = counter - 50
  822.     Me.Height = counter
  823.     Me.Top = (Screen.Height - Me.Height) / 2
  824.   Loop Until counter <= 50
  825. End Sub
  826. Private Sub formback_Click()
  827. CommonDialog1.CancelError = True
  828.  On Error GoTo errHandler
  829.  CommonDialog1.Flags = &H1
  830.  CommonDialog1.ShowColor
  831.  frmClient.BackColor = CommonDialog1.color
  832.  SSTab1.BackColor = CommonDialog1.color
  833. errHandler:
  834. End Sub
  835. Private Sub htmllink_Click()
  836. Dim rc As String
  837. rc = InputBox("Enter the URL", "HTML Link")
  838. txtChat.Text = "link:" & rc
  839. End Sub
  840. Private Sub insertip_Click()
  841. Let txtChat.Text = txtChat.Text & client.LocalIP
  842. End Sub
  843. Private Sub lastthing_Click()
  844. If lastsaid = "" Then Else txtChat.Text = lastsaid
  845. End Sub
  846. Private Sub loadbrowser_Click()
  847. BrowserMDIC.Show
  848. BrowserMDIC.WindowState = 2
  849. End Sub
  850. Private Sub mp3player_Click()
  851. frmMP3.Show
  852. End Sub
  853. Private Sub paste_Click()
  854. txtChat.Text = Clipboard.GetText
  855. End Sub
  856. Private Sub rspload_Click()
  857. client.SendData "101RSPLOAD"
  858. frmRSP.Show
  859. End Sub
  860. Private Sub sendb_Click()
  861. Command2.BackColor = thecolor()
  862. End Sub
  863. Private Sub setportb_Click()
  864. Command3.BackColor = thecolor()
  865. End Sub
  866. Private Sub showipb_Click()
  867. Command1.BackColor = thecolor()
  868. End Sub
  869. Private Sub smallw_Click()
  870. smallmsgs = 0
  871. If smallw.Checked = True Then
  872. Me.Height = 5130
  873. smallw.Checked = False
  874.     If usernamec = "" Then
  875.         StatusBar1.Panels(1).Text = "Not Connected..."
  876.     ElseIf Len(usernamec) > 0 Then
  877.         StatusBar1.Panels(1).Text = "Connected..."
  878.     End If
  879. Me.Height = 915
  880. smallw.Checked = True
  881. StatusBar1.Panels(1).Text = "You got " & smallmsgs & " msgs."
  882. End If
  883. End Sub
  884. Private Sub smallw2_Click()
  885. Call smallw_Click
  886. End Sub
  887. Private Sub tabback_Click()
  888. SSTab1.ForeColor = thecolor()
  889. End Sub
  890. Private Sub Timer2_Timer()
  891. FlashWindow hwnd, 1
  892. End Sub
  893. Private Sub Timer3_Timer()
  894. If nochatc = 5 Then
  895. Timer3.Enabled = False
  896. nochatc = nochatc + 1
  897. ProgressBar1.Value = nochatc
  898. End If
  899. End Sub
  900. Private Sub Timer4_Timer()
  901. Dim caption1 As String
  902. If Me.Caption = "" Then
  903.     Me.Caption = oldcaption
  904.     caption1 = Me.Caption
  905.     Me.Caption = Right$(caption1, Len(caption1) - 1)
  906. End If
  907. End Sub
  908. Private Sub timestamp_Click()
  909. If timestamp.Checked = True Then
  910.     timestamp.Checked = False
  911.     timestamp.Checked = True
  912. End If
  913. End Sub
  914. Private Sub tttload_Click()
  915. frmTTTC.Show
  916. client.SendData "TTTLOAD"
  917. frmTTTC.Frame1.Enabled = True
  918. frmTTTC.StatusBar1.SimpleText = "Choose your square."
  919. End Sub
  920. Private Sub txtChat_Change()
  921. Command2.Default = True
  922. If Len(txtChat.Text) > 0 And Len(usernamec) > 0 And istyping = False Then client.SendData "ISTYPING": istyping = True
  923. End Sub
  924. Private Sub Timer1_Timer()
  925. Let timercount = timercount + 1
  926. client.Close
  927. If timercount = 10 Then
  928.     StatusBar1.Panels(1).Text = "Connection failed..."
  929.     Timer1.Enabled = False
  930.     Command4.Enabled = True
  931.     client.Close
  932.     client.Connect
  933. End If
  934. End Sub
  935. Private Function thecolor() As Long
  936. CommonDialog1.CancelError = True
  937.  On Error GoTo errHandler
  938.  CommonDialog1.Flags = &H1
  939.  CommonDialog1.ShowColor
  940.  thecolor = CommonDialog1.color
  941. errHandler:
  942. End Function
  943. Private Sub txtChat_KeyDown(KeyCode As Integer, Shift As Integer)
  944. If KeyCode = vbKeyF3 Then
  945.     If lastsaid = "" Then Else txtChat.Text = lastsaid
  946. End If
  947.       
  948. End Sub
  949. Private Sub txtChat_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  950. If Button = 2 Then
  951.     If txtChat.SelText = "" Then copy.Enabled = False Else copy.Enabled = True
  952.     If Clipboard.GetText = "" Then paste.Enabled = False Else paste.Enabled = True
  953.     PopupMenu rightclickchat
  954. End If
  955. End Sub
  956. Private Sub txtRemotehost_Change()
  957. Command4.Enabled = True
  958. Command4.Default = True
  959. End Sub
  960.