Platform SDK: Agent

IAgentCharacterEx::GetActive

HRESULT GetActive(
   short * psState  // address of active state setting
);

Retrieves whether your client application is the active client of the character and whether the character is topmost.

psState
Address of a variable that receives one of the following values for the state setting:
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).

This setting lets you know whether you are the active client of the character or whether your character is the input active 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.

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, IAgentNotifySinkEx::ActiveClientChange