Given some files (or shell file files), how can I call the .MAPIMail extension .MAPIMail registered shells with them?
Question
I have some files on the computer:
C:\Users\ian\AppData\Local\Temp\Contoso_Invoice_141174.pdfC:\Users\ian\AppData\Local\Temp\Contoso_Invoice_141173.pdfC:\Users\ian\AppData\Local\Temp\Contoso_Invoice_141171.pdf
What I want to do is the software equivalent by dropping them to a registered .MAPIMail handler:

The Sent to Mail Recipient parameter is actually a registered .MAPIMail extension:

What type of file is registered in the system:
HKEY_CLASSES_ROOT\.mapimail
How to call drop on ephermeral .MAPIMail file?
Can't you just look in the registry?
Now, I can be a poor developer and spellunk registry, the default value .MAPIMail value:
CLSID\{9E56BE60-C50F-11CF-9A2C-00A0C90A90CE}
Extract clsid {9E56BE60-C50F-11CF-9A2C-00A0C90A90CE} and confirm that the class is registered:
HKEY_CLASSES_ROOT\CLSID\{9E56BE60-C50F-11CF-9A2C-00A0C90A90CE} (default) = Desktop Shortcut \InProcServer32 (default) = %SystemRoot%\System32\sendmail.dll
And use CoCreateInstance to create this COM object:
IUnknown unk = CreateComObject("{9E56BE60-C50F-11CF-9A2C-00A0C90A90CE}");
And then I ended up in an undocumented, unsupported world where I donβt know what interface I should QueryInterface for, and which methods to call in which order.
So, we have left shell programming
I would like, most likely, something related to the shell (pseudocode):
IShellFolder desktop; OleCheck(SHGetDesktopFolder(out desktop)); List<pidl> pidls = new List<pidl>(); ULONG chEaten = 0; ULONG dwAttributes = 0; PIDL pidl; foreach (String filename in Files) do { OleCheck(desktop.ParseDisplayName(0, nil, filename, out chEaten, out pidl, ref dwAttributes)); pidls.Add(pidl); }
Except for all this code, it depends on the availability of the context menu. I donβt have. No one says .MAPIMail should be in any Send to context.
I asked how to drop files in a .MAPIMail file.
And my god.
Why not just use MAPI?
Since no MAPI client is installed when you are a 32-bit application running on a 64-bit version of Windows with 64-bit Office installed. Therefore, I need to accomplish what the user can already do.