Bug 482966 - "MAPI support for Windows Explorer Send To Mail Recipient doesn't work in 3.0b2" [r+sr=bienvenu]
authorSiddharth Agarwal <sid.bugzilla@gmail.com>
Wed, 13 May 2009 19:45:03 +0100
changeset 2633 ca5f5cc54427cb796feccc31b23993950707ea8f
parent 2632 6410ed4e37b8cd9c4a58db2820a12f198f7d7ec4
child 2634 ddb74f2e593e3f0691e39a78c2f69d56455784f5
push idunknown
push userunknown
push dateunknown
bugs482966
Bug 482966 - "MAPI support for Windows Explorer Send To Mail Recipient doesn't work in 3.0b2" [r+sr=bienvenu]
mailnews/base/src/nsMessengerBootstrap.cpp
mailnews/mapi/mapiDll/Makefile.in
--- a/mailnews/base/src/nsMessengerBootstrap.cpp
+++ b/mailnews/base/src/nsMessengerBootstrap.cpp
@@ -73,16 +73,18 @@
 #include "nsMsgUtils.h"
 #include "nsEscape.h"
 #include "nsIMsgFolder.h"
 
 #ifdef XP_MACOSX
 #include "nsDirectoryServiceDefs.h"
 #endif
 
+#define MAPI_STARTUP_ARG "MapiStartup"
+
 NS_IMPL_THREADSAFE_ADDREF(nsMessengerBootstrap)
 NS_IMPL_THREADSAFE_RELEASE(nsMessengerBootstrap)
 
 NS_IMPL_QUERY_INTERFACE2(nsMessengerBootstrap,
                          nsICommandLineHandler,
                          nsIMessengerWindowService)
 
 nsMessengerBootstrap::nsMessengerBootstrap()
@@ -169,17 +171,23 @@ nsMessengerBootstrap::Handle(nsICommandL
       // check if it's a mail message url, and if so, convert it?
       scriptableURL->SetData((mailUrl));
       argsArray->AppendElement(scriptableURL);
     }
     wwatch->OpenWindow(nsnull, "chrome://messenger/content/", "_blank",
                        "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar,dialog=no", argsArray, getter_AddRefs(opened));
     aCmdLine->SetPreventDefault(PR_TRUE);
     return NS_OK;
-  } 
+  }
+
+#ifdef XP_WIN
+  // Handle MAPI startup -- do nothing
+  PRBool isMapiStartup = PR_FALSE;
+  aCmdLine->HandleFlag(NS_LITERAL_STRING(MAPI_STARTUP_ARG), PR_FALSE, &isMapiStartup);
+#endif
 
 #ifndef MOZ_SUITE
   PRInt32 numArgs;
   aCmdLine->GetLength(&numArgs);
   if (numArgs > 0)
   {
     nsAutoString mailPath;
 
--- a/mailnews/mapi/mapiDll/Makefile.in
+++ b/mailnews/mapi/mapiDll/Makefile.in
@@ -37,16 +37,20 @@
 
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
+# Statically link against the CRT, so that we don't go hunting around for it
+# and not find it when we're loaded into explorer.exe or similar
+USE_STATIC_LIBS = 1
+
 MODULE		= mozMapi32
 LIBRARY_NAME	= $(MODULE)
 DEFFILE		= $(win_srcdir)/Mapi32.def
 ifndef MOZ_INCOMPLETE_EXTERNAL_LINKAGE
 MOZILLA_INTERNAL_API = 1
 endif
 
 REQUIRES	= MapiProxy \