1f8e2c85aSAndrew Rist /**************************************************************
2*ae77b8caSAriel Constenla-Haile  *
3f8e2c85aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f8e2c85aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f8e2c85aSAndrew Rist  * distributed with this work for additional information
6f8e2c85aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f8e2c85aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f8e2c85aSAndrew Rist  * "License"); you may not use this file except in compliance
9f8e2c85aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ae77b8caSAriel Constenla-Haile  *
11f8e2c85aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ae77b8caSAriel Constenla-Haile  *
13f8e2c85aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f8e2c85aSAndrew Rist  * software distributed under the License is distributed on an
15f8e2c85aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f8e2c85aSAndrew Rist  * KIND, either express or implied.  See the License for the
17f8e2c85aSAndrew Rist  * specific language governing permissions and limitations
18f8e2c85aSAndrew Rist  * under the License.
19*ae77b8caSAriel Constenla-Haile  *
20f8e2c85aSAndrew Rist  *************************************************************/
21f8e2c85aSAndrew Rist 
22cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
23cdf0e10cSrcweir #include "precompiled_shell.hxx"
24cdf0e10cSrcweir #include <osl/diagnose.h>
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef _RTL_STRING_HXX_
27cdf0e10cSrcweir //#include <rtl/string.hxx>
28cdf0e10cSrcweir #endif
29*ae77b8caSAriel Constenla-Haile #include "sysmapi.hxx"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #define WIN32_LEAN_AND_MEAN
32cdf0e10cSrcweir #if defined _MSC_VER
33cdf0e10cSrcweir #pragma warning(push, 1)
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir #include <windows.h>
36cdf0e10cSrcweir #if defined _MSC_VER
37cdf0e10cSrcweir #pragma warning(pop)
38*ae77b8caSAriel Constenla-Haile #endif
39cdf0e10cSrcweir #include <tchar.h>
40cdf0e10cSrcweir 
41cdf0e10cSrcweir #include <iostream>
42cdf0e10cSrcweir #include <vector>
43cdf0e10cSrcweir #include <sstream>
44cdf0e10cSrcweir #include <stdexcept>
45cdf0e10cSrcweir 
46cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 2
47*ae77b8caSAriel Constenla-Haile void dumpParameter();
48cdf0e10cSrcweir #endif
49*ae77b8caSAriel Constenla-Haile 
50cdf0e10cSrcweir typedef std::vector<std::string> StringList_t;
51cdf0e10cSrcweir typedef StringList_t::const_iterator StringListIterator_t;
52cdf0e10cSrcweir typedef std::vector<MapiRecipDesc> MapiRecipientList_t;
53*ae77b8caSAriel Constenla-Haile typedef std::vector<MapiFileDesc> MapiAttachmentList_t;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir const int LEN_SMTP_PREFIX = 5; // "SMTP:"
56*ae77b8caSAriel Constenla-Haile 
57cdf0e10cSrcweir namespace /* private */
58cdf0e10cSrcweir {
59cdf0e10cSrcweir     std::string gFrom;
60cdf0e10cSrcweir     std::string gSubject;
61cdf0e10cSrcweir     std::string gBody;
62cdf0e10cSrcweir     StringList_t gTo;
63cdf0e10cSrcweir     StringList_t gCc;
64cdf0e10cSrcweir     StringList_t gBcc;
65cdf0e10cSrcweir     StringList_t gAttachments;
66cdf0e10cSrcweir     int gMapiFlags = 0;
67cdf0e10cSrcweir }
68cdf0e10cSrcweir 
69cdf0e10cSrcweir /**
70*ae77b8caSAriel Constenla-Haile     Add a prefix to an email address. MAPI requires that that
71cdf0e10cSrcweir     email addresses have an 'SMTP:' prefix.
72*ae77b8caSAriel Constenla-Haile 
73cdf0e10cSrcweir     @param  aEmailAddress
74cdf0e10cSrcweir     [in] the email address.
75*ae77b8caSAriel Constenla-Haile 
76cdf0e10cSrcweir     @param  aPrefix
77cdf0e10cSrcweir     [in] the prefix to be added to the email address.
78*ae77b8caSAriel Constenla-Haile 
79cdf0e10cSrcweir     @returns
80cdf0e10cSrcweir     the email address prefixed with the specified prefix.
81cdf0e10cSrcweir */
prefixEmailAddress(const std::string & aEmailAddress,const std::string & aPrefix="SMTP:")82cdf0e10cSrcweir inline std::string prefixEmailAddress(
83*ae77b8caSAriel Constenla-Haile     const std::string& aEmailAddress,
84cdf0e10cSrcweir     const std::string& aPrefix = "SMTP:")
85cdf0e10cSrcweir {
86cdf0e10cSrcweir     return (aPrefix + aEmailAddress);
87cdf0e10cSrcweir }
88cdf0e10cSrcweir 
89cdf0e10cSrcweir /** @internal */
addRecipient(ULONG recipClass,const std::string & recipAddress,MapiRecipientList_t * pMapiRecipientList)90*ae77b8caSAriel Constenla-Haile void addRecipient(
91*ae77b8caSAriel Constenla-Haile     ULONG recipClass,
92cdf0e10cSrcweir     const std::string& recipAddress,
93cdf0e10cSrcweir     MapiRecipientList_t* pMapiRecipientList)
94cdf0e10cSrcweir {
95cdf0e10cSrcweir     MapiRecipDesc mrd;
96cdf0e10cSrcweir     ZeroMemory(&mrd, sizeof(mrd));
97*ae77b8caSAriel Constenla-Haile 
98cdf0e10cSrcweir     mrd.ulRecipClass = recipClass;
99cdf0e10cSrcweir     mrd.lpszName = const_cast<char*>(recipAddress.c_str()) + LEN_SMTP_PREFIX;
100cdf0e10cSrcweir     mrd.lpszAddress = const_cast<char*>(recipAddress.c_str());
101cdf0e10cSrcweir     pMapiRecipientList->push_back(mrd);
102cdf0e10cSrcweir }
103cdf0e10cSrcweir 
104cdf0e10cSrcweir /** @internal */
initRecipientList(MapiRecipientList_t * pMapiRecipientList)105cdf0e10cSrcweir void initRecipientList(MapiRecipientList_t* pMapiRecipientList)
106cdf0e10cSrcweir {
107cdf0e10cSrcweir     OSL_ASSERT(pMapiRecipientList->size() == 0);
108*ae77b8caSAriel Constenla-Haile 
109cdf0e10cSrcweir     // add to recipients
110cdf0e10cSrcweir     StringListIterator_t iter = gTo.begin();
111cdf0e10cSrcweir     StringListIterator_t iter_end = gTo.end();
112cdf0e10cSrcweir     for (; iter != iter_end; ++iter)
113cdf0e10cSrcweir         addRecipient(MAPI_TO, *iter, pMapiRecipientList);
114*ae77b8caSAriel Constenla-Haile 
115cdf0e10cSrcweir     // add cc recipients
116cdf0e10cSrcweir     iter = gCc.begin();
117cdf0e10cSrcweir     iter_end = gCc.end();
118cdf0e10cSrcweir     for (; iter != iter_end; ++iter)
119*ae77b8caSAriel Constenla-Haile         addRecipient(MAPI_CC, *iter, pMapiRecipientList);
120cdf0e10cSrcweir 
121*ae77b8caSAriel Constenla-Haile     // add bcc recipients
122cdf0e10cSrcweir     iter = gBcc.begin();
123cdf0e10cSrcweir     iter_end = gBcc.end();
124cdf0e10cSrcweir     for (; iter != iter_end; ++iter)
125*ae77b8caSAriel Constenla-Haile         addRecipient(MAPI_BCC, *iter, pMapiRecipientList);
126cdf0e10cSrcweir }
127cdf0e10cSrcweir 
128cdf0e10cSrcweir /** @internal */
initAttachementList(MapiAttachmentList_t * pMapiAttachmentList)129cdf0e10cSrcweir void initAttachementList(MapiAttachmentList_t* pMapiAttachmentList)
130*ae77b8caSAriel Constenla-Haile {
131cdf0e10cSrcweir     OSL_ASSERT(pMapiAttachmentList->size() == 0);
132*ae77b8caSAriel Constenla-Haile 
133cdf0e10cSrcweir     StringListIterator_t iter = gAttachments.begin();
134*ae77b8caSAriel Constenla-Haile     StringListIterator_t iter_end = gAttachments.end();
135cdf0e10cSrcweir     for (/**/; iter != iter_end; ++iter)
136cdf0e10cSrcweir     {
137cdf0e10cSrcweir         MapiFileDesc mfd;
138cdf0e10cSrcweir         ZeroMemory(&mfd, sizeof(mfd));
139*ae77b8caSAriel Constenla-Haile         mfd.lpszPathName = const_cast<char*>(iter->c_str());
140cdf0e10cSrcweir         mfd.nPosition = sal::static_int_cast<ULONG>(-1);
141*ae77b8caSAriel Constenla-Haile         pMapiAttachmentList->push_back(mfd);
142*ae77b8caSAriel Constenla-Haile     }
143cdf0e10cSrcweir }
144cdf0e10cSrcweir 
145cdf0e10cSrcweir /** @internal */
initMapiOriginator(MapiRecipDesc * pMapiOriginator)146cdf0e10cSrcweir void initMapiOriginator(MapiRecipDesc* pMapiOriginator)
147cdf0e10cSrcweir {
148cdf0e10cSrcweir     ZeroMemory(pMapiOriginator, sizeof(MapiRecipDesc));
149*ae77b8caSAriel Constenla-Haile 
150cdf0e10cSrcweir     pMapiOriginator->ulRecipClass = MAPI_ORIG;
151cdf0e10cSrcweir     pMapiOriginator->lpszName = "";
152cdf0e10cSrcweir     pMapiOriginator->lpszAddress = const_cast<char*>(gFrom.c_str());
153cdf0e10cSrcweir }
154cdf0e10cSrcweir 
155cdf0e10cSrcweir /** @internal */
initMapiMessage(MapiRecipDesc * aMapiOriginator,MapiRecipientList_t & aMapiRecipientList,MapiAttachmentList_t & aMapiAttachmentList,MapiMessage * pMapiMessage)156*ae77b8caSAriel Constenla-Haile void initMapiMessage(
157*ae77b8caSAriel Constenla-Haile     MapiRecipDesc* aMapiOriginator,
158*ae77b8caSAriel Constenla-Haile     MapiRecipientList_t& aMapiRecipientList,
159cdf0e10cSrcweir     MapiAttachmentList_t& aMapiAttachmentList,
160*ae77b8caSAriel Constenla-Haile     MapiMessage* pMapiMessage)
161cdf0e10cSrcweir {
162cdf0e10cSrcweir     ZeroMemory(pMapiMessage, sizeof(MapiMessage));
163*ae77b8caSAriel Constenla-Haile 
164*ae77b8caSAriel Constenla-Haile     pMapiMessage->lpszSubject = const_cast<char*>(gSubject.c_str());
165cdf0e10cSrcweir     pMapiMessage->lpszNoteText = (gBody.length() ? const_cast<char*>(gBody.c_str()) : NULL);
166*ae77b8caSAriel Constenla-Haile     pMapiMessage->lpOriginator = aMapiOriginator;
167cdf0e10cSrcweir     pMapiMessage->lpRecips = aMapiRecipientList.size() ? &aMapiRecipientList[0] : 0;
168*ae77b8caSAriel Constenla-Haile     pMapiMessage->nRecipCount = aMapiRecipientList.size();
169*ae77b8caSAriel Constenla-Haile     pMapiMessage->lpFiles = aMapiAttachmentList.size() ? &aMapiAttachmentList[0] : 0;
170*ae77b8caSAriel Constenla-Haile     pMapiMessage->nFileCount = aMapiAttachmentList.size();
171cdf0e10cSrcweir }
172cdf0e10cSrcweir 
173*ae77b8caSAriel Constenla-Haile char* KnownParameter[] =
174cdf0e10cSrcweir {
175*ae77b8caSAriel Constenla-Haile     "--to",
176*ae77b8caSAriel Constenla-Haile     "--cc",
177*ae77b8caSAriel Constenla-Haile     "--bcc",
178*ae77b8caSAriel Constenla-Haile     "--from",
179*ae77b8caSAriel Constenla-Haile     "--subject",
180*ae77b8caSAriel Constenla-Haile     "--body",
181*ae77b8caSAriel Constenla-Haile     "--attach",
182*ae77b8caSAriel Constenla-Haile     "--mapi-dialog",
183*ae77b8caSAriel Constenla-Haile     "--mapi-logon-ui"
184cdf0e10cSrcweir };
185cdf0e10cSrcweir 
186cdf0e10cSrcweir const size_t nKnownParameter = (sizeof(KnownParameter)/sizeof(KnownParameter[0]));
187cdf0e10cSrcweir 
188cdf0e10cSrcweir /** @internal */
isKnownParameter(const char * aParameterName)189cdf0e10cSrcweir bool isKnownParameter(const char* aParameterName)
190cdf0e10cSrcweir {
191*ae77b8caSAriel Constenla-Haile     for (size_t i = 0; i < nKnownParameter; i++)
192*ae77b8caSAriel Constenla-Haile         if (_tcsicmp(aParameterName, KnownParameter[i]) == 0)
193cdf0e10cSrcweir             return true;
194*ae77b8caSAriel Constenla-Haile 
195*ae77b8caSAriel Constenla-Haile     return false;
196cdf0e10cSrcweir }
197cdf0e10cSrcweir 
198cdf0e10cSrcweir /** @internal */
initParameter(int argc,char * argv[])199cdf0e10cSrcweir void initParameter(int argc, char* argv[])
200cdf0e10cSrcweir {
201cdf0e10cSrcweir     for (int i = 1; i < argc; i++)
202*ae77b8caSAriel Constenla-Haile     {
203cdf0e10cSrcweir         if (!isKnownParameter(argv[i]))
204cdf0e10cSrcweir         {
205cdf0e10cSrcweir             OSL_ENSURE(false, "Wrong parameter received");
206cdf0e10cSrcweir             continue;
207cdf0e10cSrcweir         }
208*ae77b8caSAriel Constenla-Haile 
209cdf0e10cSrcweir         if ((_tcsicmp(argv[i], TEXT("--mapi-dialog")) == 0))
210cdf0e10cSrcweir         {
211cdf0e10cSrcweir             gMapiFlags |= MAPI_DIALOG;
212cdf0e10cSrcweir         }
213*ae77b8caSAriel Constenla-Haile         else if ((_tcsicmp(argv[i], TEXT("--mapi-logon-ui")) == 0))
214cdf0e10cSrcweir         {
215cdf0e10cSrcweir             gMapiFlags |= MAPI_LOGON_UI;
216cdf0e10cSrcweir         }
217cdf0e10cSrcweir         else if ((i+1) < argc) // is the value of a parameter available too?
218cdf0e10cSrcweir         {
219*ae77b8caSAriel Constenla-Haile             if (_tcsicmp(argv[i], TEXT("--to")) == 0)
220cdf0e10cSrcweir                 gTo.push_back(prefixEmailAddress(argv[i+1]));
221*ae77b8caSAriel Constenla-Haile             else if (_tcsicmp(argv[i], TEXT("--cc")) == 0)
222*ae77b8caSAriel Constenla-Haile                 gCc.push_back(prefixEmailAddress(argv[i+1]));
223*ae77b8caSAriel Constenla-Haile             else if (_tcsicmp(argv[i], TEXT("--bcc")) == 0)
224*ae77b8caSAriel Constenla-Haile                 gBcc.push_back(prefixEmailAddress(argv[i+1]));
225*ae77b8caSAriel Constenla-Haile             else if (_tcsicmp(argv[i], TEXT("--from")) == 0)
226*ae77b8caSAriel Constenla-Haile                 gFrom = prefixEmailAddress(argv[i+1]);
227*ae77b8caSAriel Constenla-Haile             else if (_tcsicmp(argv[i], TEXT("--subject")) == 0)
228*ae77b8caSAriel Constenla-Haile                 gSubject = argv[i+1];
229*ae77b8caSAriel Constenla-Haile             else if (_tcsicmp(argv[i], TEXT("--body")) == 0)
230*ae77b8caSAriel Constenla-Haile                 gBody = argv[i+1];
231*ae77b8caSAriel Constenla-Haile             else if ((_tcsicmp(argv[i], TEXT("--attach")) == 0))
232*ae77b8caSAriel Constenla-Haile                 gAttachments.push_back(argv[i+1]);
233*ae77b8caSAriel Constenla-Haile 
234*ae77b8caSAriel Constenla-Haile             i++;
235*ae77b8caSAriel Constenla-Haile         }
236*ae77b8caSAriel Constenla-Haile     }
237cdf0e10cSrcweir }
238cdf0e10cSrcweir 
239cdf0e10cSrcweir /**
240cdf0e10cSrcweir     Main.
241*ae77b8caSAriel Constenla-Haile     NOTE: Because this is program only serves implementation
242*ae77b8caSAriel Constenla-Haile     purposes and should not be used by any end user the
243*ae77b8caSAriel Constenla-Haile     parameter checking is very limited. Every unknown parameter
244*ae77b8caSAriel Constenla-Haile     will be ignored.
245cdf0e10cSrcweir */
main(int argc,char * argv[])246cdf0e10cSrcweir int main(int argc, char* argv[])
247*ae77b8caSAriel Constenla-Haile {
248*ae77b8caSAriel Constenla-Haile     //MessageBox(NULL, "Debug", "Debug", MB_OK);
249*ae77b8caSAriel Constenla-Haile 
250cdf0e10cSrcweir     initParameter(argc, argv);
251*ae77b8caSAriel Constenla-Haile 
252cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 2
253cdf0e10cSrcweir     dumpParameter();
254cdf0e10cSrcweir #endif
255*ae77b8caSAriel Constenla-Haile 
256cdf0e10cSrcweir     ULONG ulRet = MAPI_E_FAILURE;
257*ae77b8caSAriel Constenla-Haile 
258cdf0e10cSrcweir     try
259cdf0e10cSrcweir     {
260*ae77b8caSAriel Constenla-Haile         shell::WinSysMapi mapi;
261*ae77b8caSAriel Constenla-Haile 
262cdf0e10cSrcweir         // #93007# we have to set the flag MAPI_NEW_SESSION,
263cdf0e10cSrcweir         // because in the case Outlook xxx (not Outlook Express!)
264*ae77b8caSAriel Constenla-Haile         // is installed as Exchange and Mail Client a Profile
265cdf0e10cSrcweir         // selection dialog must appear because we specify no
266cdf0e10cSrcweir         // profile name, so the user has to specify a profile
267cdf0e10cSrcweir         FLAGS flFlag = MAPI_NEW_SESSION | MAPI_LOGON_UI;
268cdf0e10cSrcweir         LHANDLE hSession;
269cdf0e10cSrcweir         ulRet = mapi.MAPILogon(0, NULL, NULL, flFlag, 0L, &hSession);
270*ae77b8caSAriel Constenla-Haile 
271cdf0e10cSrcweir         if (ulRet == SUCCESS_SUCCESS)
272*ae77b8caSAriel Constenla-Haile         {
273*ae77b8caSAriel Constenla-Haile             MapiRecipDesc mapiOriginator;
274cdf0e10cSrcweir             MapiRecipientList_t mapiRecipientList;
275*ae77b8caSAriel Constenla-Haile             MapiAttachmentList_t mapiAttachmentList;
276*ae77b8caSAriel Constenla-Haile             MapiMessage mapiMsg;
277*ae77b8caSAriel Constenla-Haile 
278cdf0e10cSrcweir             initMapiOriginator(&mapiOriginator);
279cdf0e10cSrcweir             initRecipientList(&mapiRecipientList);
280*ae77b8caSAriel Constenla-Haile             initAttachementList(&mapiAttachmentList);
281*ae77b8caSAriel Constenla-Haile             initMapiMessage((gFrom.length() ? &mapiOriginator : NULL), mapiRecipientList, mapiAttachmentList, &mapiMsg);
282*ae77b8caSAriel Constenla-Haile 
283*ae77b8caSAriel Constenla-Haile             ulRet = mapi.MAPISendMail(hSession, 0, &mapiMsg, gMapiFlags, 0);
284*ae77b8caSAriel Constenla-Haile 
285cdf0e10cSrcweir             mapi.MAPILogoff(hSession, 0, 0, 0);
286*ae77b8caSAriel Constenla-Haile         }
287cdf0e10cSrcweir     }
288cdf0e10cSrcweir     catch (const std::runtime_error&
289*ae77b8caSAriel Constenla-Haile #if OSL_DEBUG_LEVEL > 0
290*ae77b8caSAriel Constenla-Haile                 ex
291*ae77b8caSAriel Constenla-Haile #endif
292*ae77b8caSAriel Constenla-Haile               )
293cdf0e10cSrcweir     {
294cdf0e10cSrcweir         OSL_ENSURE(false, ex.what());
295*ae77b8caSAriel Constenla-Haile     }
296cdf0e10cSrcweir     return ulRet;
297cdf0e10cSrcweir }
298cdf0e10cSrcweir 
299cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 2
dumpParameter()300*ae77b8caSAriel Constenla-Haile void dumpParameter()
301*ae77b8caSAriel Constenla-Haile {
302*ae77b8caSAriel Constenla-Haile     std::ostringstream oss;
303*ae77b8caSAriel Constenla-Haile 
304*ae77b8caSAriel Constenla-Haile     if (gFrom.length() > 0)
305*ae77b8caSAriel Constenla-Haile         oss << "--from" << " " << gFrom << std::endl;
306*ae77b8caSAriel Constenla-Haile 
307*ae77b8caSAriel Constenla-Haile     if (gSubject.length() > 0)
308*ae77b8caSAriel Constenla-Haile         oss << "--subject" << " " << gSubject << std::endl;
309*ae77b8caSAriel Constenla-Haile 
310*ae77b8caSAriel Constenla-Haile     if (gBody.length() > 0)
311*ae77b8caSAriel Constenla-Haile         oss << "--body" << " " << gBody << std::endl;
312*ae77b8caSAriel Constenla-Haile 
313*ae77b8caSAriel Constenla-Haile     StringListIterator_t iter = gTo.begin();
314*ae77b8caSAriel Constenla-Haile     StringListIterator_t iter_end = gTo.end();
315*ae77b8caSAriel Constenla-Haile     for (/**/; iter != iter_end; ++iter)
316*ae77b8caSAriel Constenla-Haile         oss << "--to" << " " << *iter << std::endl;
317*ae77b8caSAriel Constenla-Haile 
318*ae77b8caSAriel Constenla-Haile     iter = gCc.begin();
319*ae77b8caSAriel Constenla-Haile     iter_end = gCc.end();
320*ae77b8caSAriel Constenla-Haile     for (/**/; iter != iter_end; ++iter)
321*ae77b8caSAriel Constenla-Haile         oss << "--cc" << " " << *iter << std::endl;
322*ae77b8caSAriel Constenla-Haile 
323*ae77b8caSAriel Constenla-Haile     iter = gBcc.begin();
324*ae77b8caSAriel Constenla-Haile     iter_end = gBcc.end();
325*ae77b8caSAriel Constenla-Haile     for (/**/; iter != iter_end; ++iter)
326*ae77b8caSAriel Constenla-Haile         oss << "--bcc" << " " << *iter << std::endl;
327*ae77b8caSAriel Constenla-Haile 
328*ae77b8caSAriel Constenla-Haile     iter = gAttachments.begin();
329*ae77b8caSAriel Constenla-Haile     iter_end = gAttachments.end();
330*ae77b8caSAriel Constenla-Haile     for (/**/; iter != iter_end; ++iter)
331*ae77b8caSAriel Constenla-Haile         oss << "--attach" << " " << *iter << std::endl;
332*ae77b8caSAriel Constenla-Haile 
333*ae77b8caSAriel Constenla-Haile     if (gMapiFlags & MAPI_DIALOG)
334*ae77b8caSAriel Constenla-Haile         oss << "--mapi-dialog" << std::endl;
335*ae77b8caSAriel Constenla-Haile 
336*ae77b8caSAriel Constenla-Haile     if (gMapiFlags & MAPI_LOGON_UI)
337*ae77b8caSAriel Constenla-Haile         oss << "--mapi-logon-ui" << std::endl;
338*ae77b8caSAriel Constenla-Haile 
339*ae77b8caSAriel Constenla-Haile     MessageBox(NULL, oss.str().c_str(), "Arguments", MB_OK | MB_ICONINFORMATION);
340*ae77b8caSAriel Constenla-Haile }
341cdf0e10cSrcweir #endif
342