Platform SDK: Agent

IAgentNotifySinkEx::ActiveClientChange

HRESULT ActiveClientChange(
...long dwCharID,  // character ID
   long lStatus    // active state flag
);

Notifies a client application if its active client is no longer the active client of a character.

dwCharID
Identifier of the character for which active client status changed.
lStatus
Active state change of the client, which can be a combination of any of the following values:
Value Description
const unsigned short ACTIVATE_NOTACTIVE = 0; Your client is not the active client of the character.
const unsigned short ACTIVATE_ACTIVE = 1; Your client is the active client of the character.
const unsigned short ACTIVATE_INPUTACTIVE = 2; Your client is input-active (active client of the topmost character).

When multiple client applications share the same character, the active client of the character receives mouse input (for example, Microsoft Agent control click or drag events). Similarly, when multiple characters are displayed, the active client of the topmost character (also known as the input-active client) receives IAgentNotifySink::Command events.

When the active client of a character changes, this event passes back the ID of that character and True if your application has become the active client of the character or False if it is no longer the active client of the character.

A client application may receive this event when the user selects another client application's entry in character's pop-up menu or by voice command, the client application changes its active status, or another client application quits its connection to Microsoft Agent. Agent sends this event only to the client applications that are directly affected—those that either become the active client or stop being the active client.

You can use the Activate method to set whether your application is the active client of the character or to make your application the input-active client (which also makes the character topmost).

See Also

IAgentCharacter::Activate, IAgentCharacterEx::GetActive, IAgentNotifySink::ActivateInputState