home *** CD-ROM | disk | FTP | other *** search
/ Chip Special: HTML & Java / Chip-Special_1997-01_HTML-a-Java.bin / chatsdk / chatsdk.exe / ADMIN.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1996-12-12  |  18.5 KB  |  589 lines

  1. VERSION 4.00
  2. Begin VB.Form Main 
  3.    BackColor       =   &H00FFFFC0&
  4.    Caption         =   "MS Chat Monitoring Tool"
  5.    ClientHeight    =   8415
  6.    ClientLeft      =   1125
  7.    ClientTop       =   1845
  8.    ClientWidth     =   11655
  9.    Height          =   8820
  10.    Left            =   1065
  11.    LinkTopic       =   "Main"
  12.    ScaleHeight     =   8415
  13.    ScaleWidth      =   11655
  14.    Top             =   1500
  15.    Width           =   11775
  16.    Begin VB.CommandButton cmdClearErr 
  17.       Caption         =   "Clear Err."
  18.       Height          =   255
  19.       Left            =   120
  20.       TabIndex        =   47
  21.       Top             =   8040
  22.       Width           =   855
  23.    End
  24.    Begin VB.Frame Frame5 
  25.       BackColor       =   &H00FFFFC0&
  26.       Caption         =   "Enter/Exit Room"
  27.       Height          =   735
  28.       Left            =   6600
  29.       TabIndex        =   46
  30.       Top             =   6120
  31.       Width           =   4935
  32.       Begin VB.CommandButton cmdExitRoom 
  33.          Caption         =   "Exit Room"
  34.          Height          =   255
  35.          Left            =   3360
  36.          TabIndex        =   2
  37.          Top             =   360
  38.          Width           =   1455
  39.       End
  40.       Begin VB.CommandButton cmdCancelEntering 
  41.          Caption         =   "Cancel Entering"
  42.          Height          =   255
  43.          Left            =   1680
  44.          TabIndex        =   1
  45.          Top             =   360
  46.          Width           =   1575
  47.       End
  48.       Begin VB.CommandButton cmdEnterRoom 
  49.          Caption         =   "Enter Room"
  50.          Default         =   -1  'True
  51.          Height          =   255
  52.          Left            =   120
  53.          TabIndex        =   0
  54.          Top             =   360
  55.          Width           =   1455
  56.       End
  57.    End
  58.    Begin VB.Frame Frame4 
  59.       BackColor       =   &H00FFFFC0&
  60.       Caption         =   "Ignore Participant"
  61.       Height          =   975
  62.       Left            =   6600
  63.       TabIndex        =   44
  64.       Top             =   4920
  65.       Width           =   4935
  66.       Begin VB.CommandButton cmdDoNotIgnore 
  67.          Caption         =   "Don't Ignore"
  68.          Height          =   255
  69.          Left            =   2520
  70.          TabIndex        =   22
  71.          Top             =   600
  72.          Width           =   2175
  73.       End
  74.       Begin VB.CommandButton cmdIgnore 
  75.          Caption         =   "Ignore"
  76.          Height          =   255
  77.          Left            =   240
  78.          TabIndex        =   21
  79.          Top             =   600
  80.          Width           =   2175
  81.       End
  82.       Begin VB.Label Label5 
  83.          BackColor       =   &H00FFFFC0&
  84.          Caption         =   "Ignore or not the selected member."
  85.          Height          =   255
  86.          Left            =   1320
  87.          TabIndex        =   45
  88.          Top             =   240
  89.          Width           =   2535
  90.       End
  91.    End
  92.    Begin VB.Frame Frame3 
  93.       BackColor       =   &H00FFFFC0&
  94.       Caption         =   "Participant Privileges"
  95.       Height          =   1095
  96.       Left            =   6600
  97.       TabIndex        =   42
  98.       Top             =   3600
  99.       Width           =   4935
  100.       Begin VB.CommandButton cmdMakeHost 
  101.          Caption         =   "Make Host"
  102.          Height          =   255
  103.          Left            =   3360
  104.          TabIndex        =   20
  105.          Top             =   720
  106.          Width           =   1455
  107.       End
  108.       Begin VB.CommandButton cmdMakeParticipant 
  109.          Caption         =   "Make Participant"
  110.          Height          =   255
  111.          Left            =   1800
  112.          TabIndex        =   19
  113.          Top             =   720
  114.          Width           =   1455
  115.       End
  116.       Begin VB.CommandButton cmdMakeSpectator 
  117.          Caption         =   "Make Spectator"
  118.          Height          =   255
  119.          Left            =   120
  120.          TabIndex        =   18
  121.          Top             =   720
  122.          Width           =   1575
  123.       End
  124.       Begin VB.Label Label4 
  125.          BackColor       =   &H00FFFFC0&
  126.          Caption         =   "Change the status of the selected member."
  127.          Height          =   255
  128.          Left            =   1080
  129.          TabIndex        =   43
  130.          Top             =   360
  131.          Width           =   3255
  132.       End
  133.    End
  134.    Begin VB.Frame Frame1 
  135.       BackColor       =   &H00FFFFC0&
  136.       Caption         =   "Participant Real Name"
  137.       Height          =   2295
  138.       Left            =   6600
  139.       TabIndex        =   36
  140.       Top             =   1080
  141.       Width           =   4935
  142.       Begin VB.CommandButton cmdGetRealName 
  143.          Caption         =   "Get Real Name"
  144.          Height          =   975
  145.          Left            =   4080
  146.          TabIndex        =   17
  147.          Top             =   480
  148.          Width           =   735
  149.       End
  150.       Begin VB.Frame Frame2 
  151.          BackColor       =   &H00FFFFC0&
  152.          Caption         =   "Get Real Name from"
  153.          Height          =   1095
  154.          Left            =   120
  155.          TabIndex        =   37
  156.          Top             =   360
  157.          Width           =   3735
  158.          Begin VB.TextBox txtAlias 
  159.             Enabled         =   0   'False
  160.             Height          =   285
  161.             Left            =   1320
  162.             TabIndex        =   16
  163.             Top             =   720
  164.             Width           =   2295
  165.          End
  166.          Begin VB.OptionButton optAlias 
  167.             BackColor       =   &H00FFFFC0&
  168.             Caption         =   "This Alias"
  169.             Height          =   255
  170.             Left            =   120
  171.             TabIndex        =   15
  172.             Top             =   720
  173.             Width           =   1095
  174.          End
  175.          Begin VB.OptionButton optSelection 
  176.             BackColor       =   &H00FFFFC0&
  177.             Caption         =   "Selected member"
  178.             Height          =   255
  179.             Left            =   120
  180.             TabIndex        =   14
  181.             Top             =   360
  182.             Value           =   -1  'True
  183.             Width           =   1815
  184.          End
  185.       End
  186.       Begin VB.Label lblAsyncRealName 
  187.          Height          =   255
  188.          Left            =   1680
  189.          TabIndex        =   41
  190.          Top             =   1920
  191.          Width           =   3135
  192.       End
  193.       Begin VB.Label lblAsyncAlias 
  194.          Height          =   255
  195.          Left            =   120
  196.          TabIndex        =   40
  197.          Top             =   1920
  198.          Width           =   1335
  199.       End
  200.       Begin VB.Label Label2 
  201.          BackColor       =   &H00FFFFC0&
  202.          Caption         =   "Real Name:"
  203.          Height          =   255
  204.          Left            =   1680
  205.          TabIndex        =   39
  206.          Top             =   1680
  207.          Width           =   1215
  208.       End
  209.       Begin VB.Label Label1 
  210.          BackColor       =   &H00FFFFC0&
  211.          Caption         =   "Alias:"
  212.          Height          =   255
  213.          Left            =   120
  214.          TabIndex        =   38
  215.          Top             =   1680
  216.          Width           =   735
  217.       End
  218.    End
  219.    Begin VB.CommandButton cmdKickBan 
  220.       Caption         =   "Kick, Ban and Re-instate Participant"
  221.       Height          =   255
  222.       Left            =   6600
  223.       TabIndex        =   6
  224.       Top             =   7560
  225.       Width           =   3255
  226.    End
  227.    Begin VB.CommandButton cmdChangeControlUI 
  228.       Caption         =   "Change Control UI"
  229.       Height          =   255
  230.       Left            =   9840
  231.       TabIndex        =   5
  232.       Top             =   7080
  233.       Width           =   1695
  234.    End
  235.    Begin VB.CommandButton cmdSetMaxMembers 
  236.       Caption         =   "Set MaxMembers"
  237.       Height          =   255
  238.       Left            =   3240
  239.       TabIndex        =   12
  240.       Top             =   1800
  241.       Width           =   1455
  242.    End
  243.    Begin VB.CommandButton cmdGetMaxMembers 
  244.       Caption         =   "Get MaxMembers"
  245.       Height          =   255
  246.       Left            =   4800
  247.       TabIndex        =   13
  248.       Top             =   1800
  249.       Width           =   1455
  250.    End
  251.    Begin VB.TextBox txtMaxMembers 
  252.       Height          =   285
  253.       Left            =   1680
  254.       TabIndex        =   11
  255.       Top             =   1800
  256.       Width           =   975
  257.    End
  258.    Begin VB.TextBox txtError 
  259.       BackColor       =   &H000080FF&
  260.       Height          =   285
  261.       Left            =   1080
  262.       TabIndex        =   31
  263.       Top             =   8040
  264.       Width           =   10455
  265.    End
  266.    Begin VB.TextBox txtState 
  267.       BackColor       =   &H000000C0&
  268.       Height          =   285
  269.       Left            =   10440
  270.       TabIndex        =   30
  271.       Text            =   "Disconnected"
  272.       Top             =   360
  273.       Width           =   1095
  274.    End
  275.    Begin VB.CommandButton cmdGetMemberCount 
  276.       Caption         =   "Get MemberCount"
  277.       Height          =   255
  278.       Left            =   4800
  279.       TabIndex        =   10
  280.       Top             =   1440
  281.       Width           =   1455
  282.    End
  283.    Begin VB.TextBox txtMemberCount 
  284.       Height          =   285
  285.       Left            =   1680
  286.       TabIndex        =   9
  287.       Top             =   1440
  288.       Width           =   975
  289.    End
  290.    Begin VB.CommandButton cmdWhisperNoWhisper 
  291.       Caption         =   "No/Whisper"
  292.       Height          =   255
  293.       Left            =   6600
  294.       TabIndex        =   3
  295.       Top             =   7080
  296.       Width           =   1455
  297.    End
  298.    Begin VB.CommandButton cmdSetTopic 
  299.       Caption         =   "Set Topic"
  300.       Height          =   255
  301.       Left            =   4800
  302.       TabIndex        =   8
  303.       Top             =   1080
  304.       Width           =   1455
  305.    End
  306.    Begin VB.TextBox txtTopic 
  307.       Height          =   285
  308.       Left            =   1680
  309.       TabIndex        =   7
  310.       Top             =   1080
  311.       Width           =   3015
  312.    End
  313.    Begin VB.CommandButton cmdClearHistory 
  314.       Caption         =   "Clear History"
  315.       Height          =   255
  316.       Left            =   8280
  317.       TabIndex        =   4
  318.       Top             =   7080
  319.       Width           =   1335
  320.    End
  321.    Begin VB.CommandButton cmdExit 
  322.       Caption         =   "Exit"
  323.       Height          =   255
  324.       Left            =   10080
  325.       TabIndex        =   23
  326.       Top             =   7560
  327.       Width           =   1455
  328.    End
  329.    Begin MSChatObjectsCtl.MSChat MSChat1 
  330.       Height          =   5775
  331.       Left            =   120
  332.       TabIndex        =   48
  333.       Top             =   2160
  334.       Width           =   6375
  335.       _ExtentX        =   11245
  336.       _ExtentY        =   10186
  337.       BorderStyle     =   0
  338.       UIOption        =   4095
  339.       BackColor       =   192
  340.    End
  341.    Begin VB.Label lblRoomPath 
  342.       Height          =   255
  343.       Left            =   4800
  344.       TabIndex        =   35
  345.       Top             =   360
  346.       Width           =   5175
  347.    End
  348.    Begin VB.Label lblUserName 
  349.       Height          =   255
  350.       Left            =   2520
  351.       TabIndex        =   34
  352.       Top             =   360
  353.       Width           =   1815
  354.    End
  355.    Begin VB.Label lblAlias 
  356.       Height          =   255
  357.       Left            =   120
  358.       TabIndex        =   33
  359.       Top             =   360
  360.       Width           =   1935
  361.    End
  362.    Begin VB.Label lblMaxMembers 
  363.       Alignment       =   1  'Right Justify
  364.       BackColor       =   &H00FFFFC0&
  365.       Caption         =   "MaxMembers"
  366.       Height          =   255
  367.       Left            =   480
  368.       TabIndex        =   32
  369.       Top             =   1800
  370.       Width           =   975
  371.    End
  372.    Begin VB.Label Label18 
  373.       BackColor       =   &H00FFFFC0&
  374.       Caption         =   "State"
  375.       Height          =   255
  376.       Left            =   10440
  377.       TabIndex        =   29
  378.       Top             =   120
  379.       Width           =   615
  380.    End
  381.    Begin VB.Label Label15 
  382.       Alignment       =   1  'Right Justify
  383.       BackColor       =   &H00FFFFC0&
  384.       Caption         =   "Member Count"
  385.       Height          =   255
  386.       Left            =   360
  387.       TabIndex        =   28
  388.       Top             =   1440
  389.       Width           =   1095
  390.    End
  391.    Begin VB.Label Label13 
  392.       Alignment       =   1  'Right Justify
  393.       BackColor       =   &H00FFFFC0&
  394.       Caption         =   "Chat Room Topic"
  395.       Height          =   255
  396.       Left            =   120
  397.       TabIndex        =   27
  398.       Top             =   1080
  399.       Width           =   1335
  400.    End
  401.    Begin VB.Label Label10 
  402.       BackColor       =   &H00FFFFC0&
  403.       Caption         =   "Name"
  404.       Height          =   255
  405.       Left            =   2520
  406.       TabIndex        =   26
  407.       Top             =   120
  408.       Width           =   1815
  409.    End
  410.    Begin VB.Label Label8 
  411.       BackColor       =   &H00FFFFC0&
  412.       Caption         =   "Room Path"
  413.       Height          =   255
  414.       Left            =   4800
  415.       TabIndex        =   25
  416.       Top             =   120
  417.       Width           =   5175
  418.    End
  419.    Begin VB.Label Label7 
  420.       BackColor       =   &H00FFFFC0&
  421.       Caption         =   "Alias "
  422.       Height          =   255
  423.       Left            =   120
  424.       TabIndex        =   24
  425.       Top             =   120
  426.       Width           =   1935
  427.    End
  428. Attribute VB_Name = "Main"
  429. Attribute VB_Creatable = False
  430. Attribute VB_Exposed = False
  431. Option Explicit
  432. Const MASK_PRIVILEGES = 1
  433. Const MASK_NOWHISPER = 2
  434. Const MASK_IGNORED = 4
  435. Const STAT_HOST = 1
  436. Const STAT_PARTICIPANT = 2
  437. Const STAT_SPECTATOR = 4
  438. Const STAT_NOWHISPER = 8
  439. Const STAT_IGNORED = 16
  440. Const CAP_NOWHISPER = "Deny Whispers"
  441. Const CAP_WHISPER = "Accept Whispers"
  442. Sub SetState(NewState As Integer)
  443.     Select Case NewState
  444.     Case 1:
  445.         cmdEnterRoom.Enabled = True
  446.         cmdCancelEntering.Enabled = False
  447.         cmdExitRoom.Enabled = False
  448.         txtState.Text = "Disconnected"
  449.         txtState.BackColor = &HC0&
  450.         MSChat1.BackColor = &HC0&
  451.     Case 2:
  452.         cmdEnterRoom.Enabled = False
  453.         cmdCancelEntering.Enabled = True
  454.         cmdExitRoom.Enabled = False
  455.         txtState.Text = "Connecting..."
  456.         txtState.BackColor = &H80FF&
  457.         MSChat1.BackColor = &H80FF&
  458.     Case 3:
  459.         cmdEnterRoom.Enabled = False
  460.         cmdCancelEntering.Enabled = False
  461.         cmdExitRoom.Enabled = True
  462.         txtState.Text = "Connected"
  463.         txtState.BackColor = &HC000&
  464.         MSChat1.BackColor = &HC000&
  465.     End Select
  466. End Sub
  467. Private Sub cmdChangeControlUI_Click()
  468.     UISettings.Show
  469. End Sub
  470. Private Sub cmdClearErr_Click()
  471.     txtError.Text = ""
  472. End Sub
  473. Private Sub cmdGetMaxMembers_Click()
  474.     On Error Resume Next
  475.     txtMaxMembers.Text = CStr(MSChat1.MaxMembers)
  476. End Sub
  477. Private Sub cmdGetRealName_Click()
  478.     On Error Resume Next
  479.     Dim txtReal As String
  480.     lblAsyncAlias.Caption = ""
  481.     lblAsyncRealName.Caption = ""
  482.     If (optSelection.Value) Then
  483.         MSChat1.GetParticipantRealName -1, "", False, txtReal
  484.     Else
  485.         MSChat1.GetParticipantRealName 0, txtAlias.Text, False, txtReal
  486.     End If
  487. End Sub
  488. Private Sub cmdGetMemberCount_Click()
  489.     On Error Resume Next
  490.     txtMemberCount.Text = CStr(MSChat1.MemberCount)
  491. End Sub
  492. Private Sub cmdKickBan_Click()
  493.     KickBan.Show
  494. End Sub
  495. Private Sub cmdMakeHost_Click()
  496.     On Error Resume Next
  497.     MSChat1.SetParticipantStatus -1, MASK_PRIVILEGES, STAT_HOST
  498. End Sub
  499. Private Sub cmdMakeParticipant_Click()
  500.     On Error Resume Next
  501.     MSChat1.SetParticipantStatus -1, MASK_PRIVILEGES, STAT_PARTICIPANT
  502. End Sub
  503. Private Sub cmdMakeSpectator_Click()
  504.     On Error Resume Next
  505.     MSChat1.SetParticipantStatus -1, MASK_PRIVILEGES, STAT_SPECTATOR
  506. End Sub
  507. Private Sub cmdSetMaxMembers_Click()
  508.     On Error Resume Next
  509.     MSChat1.MaxMembers = CLng(txtMaxMembers.Text)
  510. End Sub
  511. Private Sub Form_Unload(Cancel As Integer)
  512.     Unload UISettings
  513.     Unload EnterOptions
  514.     Unload KickBan
  515. End Sub
  516. Private Sub MSChat1_OnParticipantRealName(ByVal Alias As String, ByVal RealName As String)
  517.     On Error Resume Next
  518.     lblAsyncAlias.Caption = Alias
  519.     lblAsyncRealName.Caption = RealName
  520. End Sub
  521. Private Sub MSChat1_OnRoomTopicChanged(ByVal NewRoomTopic As String)
  522.     On Error Resume Next
  523.     txtTopic.Text = NewRoomTopic
  524. End Sub
  525. Private Sub MSChat1_OnStateChanged(ByVal NewState As Integer)
  526.     SetState NewState
  527. End Sub
  528. Private Sub cmdCancelEntering_Click()
  529.     On Error Resume Next
  530.     MSChat1.CancelEntering
  531. End Sub
  532. Private Sub cmdClearHistory_Click()
  533.     On Error Resume Next
  534.     MSChat1.ClearHistory
  535. End Sub
  536. Private Sub cmdDoNotIgnore_Click()
  537.     On Error Resume Next
  538.     MSChat1.SetParticipantStatus -1, MASK_IGNORED, 0
  539. End Sub
  540. Private Sub cmdEnterRoom_Click()
  541.     EnterOptions.Show
  542. End Sub
  543. Private Sub cmdExit_Click()
  544.     End
  545. End Sub
  546. Private Sub cmdExitRoom_Click()
  547.     On Error Resume Next
  548.     MSChat1.ExitRoom
  549. End Sub
  550. Private Sub cmdIgnore_Click()
  551.     On Error Resume Next
  552.     MSChat1.SetParticipantStatus -1, MASK_IGNORED, STAT_IGNORED
  553. End Sub
  554. Private Sub cmdSetTopic_Click()
  555.     On Error Resume Next
  556.     MSChat1.RoomTopic = txtTopic.Text
  557. End Sub
  558. Private Sub cmdWhisperNoWhisper_Click()
  559.     On Error Resume Next
  560.     If (cmdWhisperNoWhisper.Caption = CAP_NOWHISPER) Then
  561.         MSChat1.SetParticipantStatus MSChat1.ThisParticipantID, MASK_NOWHISPER, STAT_NOWHISPER
  562.         cmdWhisperNoWhisper.Caption = CAP_WHISPER
  563.     Else
  564.         MSChat1.SetParticipantStatus MSChat1.ThisParticipantID, MASK_NOWHISPER, 0
  565.         cmdWhisperNoWhisper.Caption = CAP_NOWHISPER
  566.     End If
  567. End Sub
  568. Private Sub Form_Load()
  569.     cmdWhisperNoWhisper.Caption = CAP_NOWHISPER
  570. End Sub
  571. Private Sub MSChat1_OnEndEnumeration()
  572.     On Error Resume Next
  573.     txtTopic.Text = MSChat1.RoomTopic
  574.     lblUserName.Caption = MSChat1.ThisParticipantName
  575.     lblRoomPath.Caption = MSChat1.RoomPath
  576.     cmdGetMemberCount_Click
  577.     cmdGetMaxMembers_Click
  578. End Sub
  579. Private Sub MSChat1_OnError(ByVal ErrorCode As Integer, ByVal Description As String)
  580.     On Error Resume Next
  581.     txtError.Text = "MSChat1 error " + CStr(ErrorCode) + ", Desc: " + Description
  582. End Sub
  583. Private Sub optAlias_Click()
  584.     txtAlias.Enabled = True
  585. End Sub
  586. Private Sub optSelection_Click()
  587.     txtAlias.Enabled = False
  588. End Sub
  589.