IMAPIViewContext::ActivateNext

The IMAPIViewContext::ActivateNext method activates the next or previous message in a view.

Quick Info

See IMAPIViewContext : IUnknownTR60NE.

 

HRESULT ActivateNext(

    ULONG ulDir,

 

    LPCRECT prcPosRect

 

   )

 

 

Parameters

ulDir

[in] Status value indicating which message to activate. The value can be one of the following flags:

VCDIR_DELETE

Activates the next message because the current message has been deleted.

VCDIR_MOVE

Activates the next message because the current message has been moved.

VCDIR_NEXT

Activates the next message in the view order.

VCDIR_PREV

Activates the previous message in the view order.

prcPosRect

[in] Pointer to a RECT structure containing the size and position of the window used to display the message to activate.

 

Return Values

S_OK

The call succeeded and has returned the expected value or values.

S_FALSE

The call succeeded but a different type of form was opened; call the IMAPIForm::ShutdownForm6.2DUS method for your form object.

 

Remarks

Form objects call the IMAPIViewContext::ActivateNext method to change what message is displayed to the user. The value passed in the ulDir parameter informs the form viewer why and how the current message status has been changed. The VCDIR_NEXT and VCDIR_PREVIOUS flags correspond to users choosing the Next and Previous command in a view, respectively. These operations usually correspond to moving up or down one message in the form viewer s list of messages.

The VCDIR_DELETE and VCDIR_MOVE flags are set by the IMAPIMessageSite::DeleteMessage6167QE and IMAPIMessageSite::MoveMessage1_9755P methods, respectively. Implementations of these methods call ActivateNext with the appropriate direction and then perform the requested operation on the message, if the ActivateNext call did not fail. Form viewers typically enable users to specify the direction to move in the message list.

Upon return from ActivateNext, form objects must check for a current message and go through normal shutdown if a message is not present. If a next or previous message is displayed, the form uses the window rectangle passed in the prcPosRect parameter to display it.

Notes to Implementers

The client application s implementation of IMAPIViewContext::ActivateNextSLASEP just needs to make the next or previous message (depending on the ulDir parameter) in the folder the current one. After ActivateNext returns, the form object will call IMAPIMessageSite::GetMessage129_Y38 to get a pointer to the newly activated message.

For more information about implementing the interfaces related to form servers, see MAPI Form Interfaces Used by Client Applications1AR39HN.

See Also

IMAPIViewContext::GetViewStatus