IMessengerContact::Blocked Property
Deprecated. Sets or retrieves a Boolean value that declares whether the contact associated with this MessengerContact object is blocked by the current client user.
Syntax
HRESULT IMessengerContact::get_Blocked(VARIANT_BOOL *pBoolBlock); HRESULT IMessengerContact::put_Blocked(VARIANT_BOOL vBoolBlock);
Parameters
- pBoolBlock
Pointer to a variable of type VARIANT_BOOL that receives whether this user is blocked by the current client user. VARIANT_TRUE indicates that the user is blocked. VARIANT_FALSE indicates that the user is not blocked.- vBoolBlock
VARIANT_BOOL that specifies whether this user is blocked by the current client user. VARIANT_TRUE indicates that the user is blocked. VARIANT_FALSE indicates that the user is not blocked.
Return Value
Returns one of the following values:
S_OK Success. S_FALSE Attempted to block an already blocked user or unblock a user who was not blocked. E_FAIL General internal failure. DISP_E_BADVARTYPE Error returned by VARIANT handling library. E_OUTOFMEMORY Error returned by VARIANT handling library. E_INVALIDARG Requested an out-of-range property. This is not normally returned through this interface because the API calls a property that is known to be in range. RPC_X_NULL_REF_POINTER pBoolBlock is a NULL pointer.
Remarks
Blocking is not necessarily reciprocal. User A may have blocked User B, but if User B hasn't blocked User A, then User A can still receive status updates about User B (if User B is on User A's contact list). Blocking a user does not remove the user from the Contact List or the MessengerContacts collection. Clients should decide how to enforce a logical relationship between blocking users and getting blocked users out of the Contact List.
Assuming the MessengerContact object can be successfully created (which can only be done with an online client), calling this method against a MessengerContact object while the client is offline will always return pBoolBlock==FALSE, even if the contact in question really is blocked. Property information cannot be determined while offline, but will not throw an error.
Note This property is not available for scripting languages.
Important IMessengerContact::Blocked is no longer available in Windows Vista. See Windows Messenger for more information.