The LinkMessageToMessage function extracts the necessary properties (PR_ENTRYID, PR_PARENT_ENTRYID, PR_STORE_ENTRYID, PR_SUBJECT) from one message and uses them to create a link to that message in a second message.
STDAPI LinkMessageToMessage(
LPMESSAGE pmsgLink,
LPMESSAGE pmsgOuter,
HANDLE hicon,
ULNOG ulPos
);