This section describes the events associated with the Microsoft Chat control.
Occurs when a user enters a chat room, before the list of members already in the conversation appears in the Participant list box.
object_OnBeginEnumeration
Value Description object Required. An object expression that evaluates to a Chat control.
Occurs after getting the initial list of members in the conversation, including the user.
object_OnEndEnumeration
Value Description object Required. An object expression that evaluates to a Chat control.
The user can start to use the ThisParticipantID property or the SetParticipantStatus, KickParticipant, BanParticipant, and SendMessage methods once this event is triggered.
Occurs when either the list of members already in the conversation first appears when entering a chat room or when a new participant joins the conversation.
object_OnEnterParticipant(ParticipantID, Name, Status)
Value Description object Required. An object expression that evaluates to a Chat control. ParticipantID A long integer value that contains the participant ID of the member entering the chat room. Name A BSTR value that contains the alias of the member joining the chat room. Status A short integer value indicating the status of the member entering the room. Can be one of the following values.
Value Description 1 Member is a host. 2 Member is a participant. 4 Member is a spectator.
Occurs when there is an error in the control. If the display dialog boxes flag (value=512) is set in the UIOption property, the error message is displayed to the user.
object_OnError(ErrorCode, Description)
Value Description object Required. An object expression that evaluates to a Chat control. ErrorCode A short integer value that contains the numeric value of the error code. Description A BSTR value that contains the error message that is associated with the error code.
Occurs when a member leaves the chat room.
object_OnExitParticipant(ParticipantID)
Value Description object Required. An object expression that evaluates to a Chat control. ParticipantID A long integer value that contains the participant ID of the member exiting the chat room.
Occurs each time a message is added to the History text box, when the total number of characters in the History text box is at least 90 percent of the MaxHistoryLength property (which is the maximum number of characters allowed in the History text box).
object_OnHistoryFull(Percent)
Value Description object Required. An object expression that evaluates to a Chat control. Percent The exact percentage of the History text box's maximum length that has been used.
If the History text box gets too full to contain an incoming message, the top 20 percent of the text box's contents are removed. If this does not give enough space to fit the incoming message, more text is removed.
Occurs when a user gets a message from a member or the chat room.
object_OnMessage(SenderID, Message, MessageType)
Value Description object Required. An object expression that evaluates to a Chat control. SenderID A long integer that contains the participant ID of the member who sent the message, or zero if the message comes from the chat room. Message A VARIANT value that contains the message. The incoming message can be a text message (BSTR) or data (an array of bytes, shorts, longs, floats, doubles, Booleans, errors, currencies, or dates). MessageType Can be a combination of the following values.
Value Description 0 A text or data message that is broadcast to all members. 1 A text or data message that is whispered to one or more members. 2 A ComicChat thought, which is text only. 4 An action, which is text only.
Occurs when the member's alias is changed. Also, if the display notifications flag (value=128) is set in the UIOption property, a dialog box is displayed that says: "<OldAlias> is now known as <NewAlias>."
object_OnParticipantAliasChanged(ParticipantID, OldAlias, NewAlias)
Value Description object Required. An object expression that evaluates to a Chat control. ParticipantID A long integer value that contains the participant ID of the member whose alias is changing. OldAlias A BSTR value that contains the old alias. NewAlias A BSTR value that contains the new alias.
Occurs when a member invites the user to the member's chat room.
object_OnParticipantInvited(RoomName, Alias)
Value Description object Required. An object expression that evaluates to a Chat control. RoomName A string value containing the name of the member's chat room. Alias A string value containing the name of the member who invited the user to the member's chat room.
Occurs when the user is kicked from the chat room.
object_OnParticipantKicked(ParticipantID, Reason)
Value Description object Required. An object expression that evaluates to a Chat control. ParticipantID A long integer value that contains the participant ID of the host who kicked the user from the chat room. Reason A BSTR value that contains the reason given for kicking the user from the chat room. This value can be an empty string, if no reason was given.
Occurs when a successful call is made to GetParticipantRealName with the Synchronous parameter set to FALSE.
object_OnParticipantRealName(Alias, RealName)
Value Description object Required. An object expression that evaluates to a Chat control. Alias A BSTR value that contains the current alias of the member. RealName A BSTR value that contains the real name of the member.
Occurs when a member changes status.
object_OnParticipantStatusChanged(ParticipantID, Status)
Value Description object Required. An object expression that evaluates to a Chat control. ParticipantID A long integer value that contains the participant ID of the member whose status is changing. Status A short integer value that indicates the new status of the member. The new status is a combination of the following values.
Value Description 1 Member has become a host. 2 Member has become a participant. 4 Member has become a spectator. 8 Member does not allow whispers. 16 Member is ignored, so all incoming messages from this member are discarded.
Any member is either a host (Status=1), participant (Status=2), or spectator (Status=4), so a valid status must include one of these values.
Occurs when the room topic property changes.
object_OnRoomTopicChanged(NewRoomTopic)
Value Description object Required. An object expression that evaluates to a Chat control. NewRoomTopic A BSTR value that contains the description of the new topic of conversation.
Gives the value of the new room type.
object_OnRoomTypeChanged(NewRoomType)
Value Description object Required. An object expression that evaluates to a Chat control. NewRoomType A short integer value that equals the sum of the room type settings. Can be a combination of the following values.
Value Description 1 Allows any user into the chat room. 2 Allows only hosts to change the topic of the chat room. 4 Allows only users who logged on to this server to enter the chat room. 8 Disables whispering in the chat room. 16 Creates an auditorium room. The member list shows only the user and the hosts. Participants cannot whisper, but hosts can whisper to anybody, regardless of whether the no-whisper (NewRoomType=8) flag is set. Messages coming from participants are sent only to the hosts. 32 Creates a moderated room. Members join the chat room as spectators by default.
For example, if NewRoomType=10, it means that only hosts can change the room topic (NewRoomType=2), and no whispers are allowed in the room (NewRoomType=8).
Occurs when the user's state changes.
object_OnStateChanged(NewState)
Value Description object Required. An object expression that evaluates to a Chat control. NewState A short integer that indicates the user's new state. Can be one of the following values.
Value Description 1 Disconnected from any chat rooms. 2 Connecting to a chat room. 3 Connected to a chat room.
Occurs whenever the user sends a text message by using the internal Send button or Whisper button.
object_OnTextMessageSent(TextMessage, MessageType)
Value Description object Required. An object expression that evaluates to a Chat control. TextMessage A BSTR value that contains the text sent by the user. MessageType A short integer value that indicates the type of message sent. Can be one of the following values.
Value Description 0 The user sent some text as a broadcast to all members. 1 The user sent some text as a whisper to one or more members.
This event is not triggered when using the SendMessage method.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.