diff --git a/browser/app/splash.rc b/browser/app/splash.rc index d314a65ed311..a5bb52fe5b2b 100644 --- a/browser/app/splash.rc +++ b/browser/app/splash.rc @@ -48,10 +48,8 @@ IDI_APPLICATION ICON FIREFOX_ICO STRINGTABLE DISCARDABLE BEGIN #ifdef DEBUG - ID_DDE_APPLICATION_NAME, "Firefox Debug" IDS_STARTMENU_APPNAME, "Firefox Debug" #else - ID_DDE_APPLICATION_NAME, "Firefox" IDS_STARTMENU_APPNAME, "Firefox" #endif END diff --git a/browser/app/splashos2.rc b/browser/app/splashos2.rc index 226165ad441c..cd82e3ccc70c 100644 --- a/browser/app/splashos2.rc +++ b/browser/app/splashos2.rc @@ -29,10 +29,6 @@ // Splash screen bitmap ID. #define IDB_SPLASH 101 -// DDE application name -#define ID_DDE_APPLICATION_NAME 102 - - ICON 1 FIREFOX_ICO DLGTEMPLATE IDD_SPLASH DISCARDABLE @@ -44,15 +40,6 @@ END //BITMAP IDB_SPLASH "splash.bmp" -STRINGTABLE DISCARDABLE -BEGIN -#ifdef DEBUG - ID_DDE_APPLICATION_NAME, "Firefox Debug" -#else - ID_DDE_APPLICATION_NAME, "Firefox" -#endif -END - #ifdef MOZ_STATIC_BUILD #include "wdgtos2rc.h" diff --git a/calendar/sunbird/app/splash.rc b/calendar/sunbird/app/splash.rc index aade6739a414..19e455e45094 100644 --- a/calendar/sunbird/app/splash.rc +++ b/calendar/sunbird/app/splash.rc @@ -44,15 +44,11 @@ IDI_APPICON ICON "sunbird.ico" IDI_APPLICATION ICON "sunbird.ico" -#define ID_DDE_APPLICATION_NAME 102 - STRINGTABLE DISCARDABLE BEGIN #ifdef DEBUG - ID_DDE_APPLICATION_NAME, "Sunbird Debug" IDS_STARTMENU_APPNAME, "Sunbird Debug" #else - ID_DDE_APPLICATION_NAME, "Sunbird" IDS_STARTMENU_APPNAME, "Sunbird" #endif END diff --git a/calendar/sunbird/app/splashos2.rc b/calendar/sunbird/app/splashos2.rc index 25d9cfc63f95..6815e4ee0c46 100644 --- a/calendar/sunbird/app/splashos2.rc +++ b/calendar/sunbird/app/splashos2.rc @@ -29,10 +29,6 @@ // Splash screen bitmap ID. #define IDB_SPLASH 101 -// DDE application name -#define ID_DDE_APPLICATION_NAME 102 - - ICON 1 SUNBIRD_ICO DLGTEMPLATE IDD_SPLASH DISCARDABLE @@ -44,15 +40,6 @@ END //BITMAP IDB_SPLASH "splash.bmp" -STRINGTABLE DISCARDABLE -BEGIN -#ifdef DEBUG - ID_DDE_APPLICATION_NAME, "Sunbird Debug" -#else - ID_DDE_APPLICATION_NAME, "Sunbird" -#endif -END - #ifdef MOZ_STATIC_BUILD #include "wdgtos2rc.h" diff --git a/composer/app/module.rc b/composer/app/module.rc index bc13b8c3ffc0..f81b8735ffa9 100644 --- a/composer/app/module.rc +++ b/composer/app/module.rc @@ -91,9 +91,6 @@ // Splash screen bitmap ID. #define IDB_SPLASH 101 -// DDE application name -#define ID_DDE_APPLICATION_NAME 102 - // Program icon. IDI_APPLICATION ICON "mozilla.ico" @@ -120,7 +117,6 @@ IDD_SPLASH DIALOGEX STRINGTABLE DISCARDABLE BEGIN - ID_DDE_APPLICATION_NAME, "Composer" IDS_STARTMENU_APPNAME, "Composer" END diff --git a/composer/app/splash.rc b/composer/app/splash.rc index 0c7db09be90f..f390ba41c722 100644 --- a/composer/app/splash.rc +++ b/composer/app/splash.rc @@ -46,9 +46,6 @@ // Splash screen bitmap ID. #define IDB_SPLASH 101 -// DDE application name -#define ID_DDE_APPLICATION_NAME 102 - // Program icon. IDI_APPLICATION ICON "mozilla.ico" @@ -75,6 +72,5 @@ IDD_SPLASH DIALOGEX STRINGTABLE DISCARDABLE BEGIN - ID_DDE_APPLICATION_NAME, "Composer" IDS_STARTMENU_APPNAME, "Composer" END diff --git a/mail/app/splash.rc b/mail/app/splash.rc index b7563c5f7cab..786e4b1934c5 100644 --- a/mail/app/splash.rc +++ b/mail/app/splash.rc @@ -43,15 +43,11 @@ // Program icon. IDI_APPLICATION ICON THUNDERBIRD_ICO -#define ID_DDE_APPLICATION_NAME 102 - STRINGTABLE DISCARDABLE BEGIN #ifdef DEBUG - ID_DDE_APPLICATION_NAME, "Thunderbird Debug" IDS_STARTMENU_APPNAME, "Thunderbird Debug" #else - ID_DDE_APPLICATION_NAME, "Thunderbird" IDS_STARTMENU_APPNAME, "Thunderbird" #endif END diff --git a/mail/app/splashos2.rc b/mail/app/splashos2.rc index fac3d71e53ef..7a450646dda2 100644 --- a/mail/app/splashos2.rc +++ b/mail/app/splashos2.rc @@ -29,10 +29,6 @@ // Splash screen bitmap ID. #define IDB_SPLASH 101 -// DDE application name -#define ID_DDE_APPLICATION_NAME 102 - - ICON 1 "mozos2.ico" DLGTEMPLATE IDD_SPLASH DISCARDABLE @@ -44,11 +40,6 @@ END //BITMAP IDB_SPLASH "splash.bmp" -STRINGTABLE DISCARDABLE -BEGIN - ID_DDE_APPLICATION_NAME, "Thunderbird" -END - #ifdef MOZ_STATIC_BUILD // XXX This code is copied from resource.h and widget.rc. It's a work-around diff --git a/toolkit/xre/nsNativeAppSupportOS2.cpp b/toolkit/xre/nsNativeAppSupportOS2.cpp index 1a2b3ed8a054..128fd73c6caa 100644 --- a/toolkit/xre/nsNativeAppSupportOS2.cpp +++ b/toolkit/xre/nsNativeAppSupportOS2.cpp @@ -45,6 +45,8 @@ #include "nsNativeAppSupportBase.h" #include "nsNativeAppSupportOS2.h" +#include "nsAppRunner.h" +#include "nsXULAppAPI.h" #include "nsString.h" #include "nsICmdLineService.h" #include "nsCOMPtr.h" @@ -342,7 +344,6 @@ private: static HSZ mApplication, mTopics[ topicCount ]; static DWORD mInstance; - static char *mAppName; static PRBool mCanHandleRequests; static char mMutexName[]; static PRBool mUseDDE; @@ -581,7 +582,7 @@ struct MessageWindow { if ( !mClassName ) { sprintf( classNameBuffer, "%s%s", - nsNativeAppSupportOS2::mAppName, + gAppData->appName, "MessageWindow" ); mClassName = classNameBuffer; } @@ -716,8 +717,6 @@ private: USHORT mMsgWindowAtom; }; // struct MessageWindow -static char nameBuffer[128] = { 0 }; -char *nsNativeAppSupportOS2::mAppName = nameBuffer; PRBool nsNativeAppSupportOS2::mUseDDE = PR_FALSE; /* Start: Tries to find the "message window" to determine if it @@ -754,17 +753,9 @@ nsNativeAppSupportOS2::Start( PRBool *aResult ) { } // Grab mutex first. - int retval; - UINT id = ID_DDE_APPLICATION_NAME; - retval = WinLoadString( NULLHANDLE, NULLHANDLE, id, sizeof(nameBuffer), nameBuffer ); - if ( retval == 0 ) { - // No app name; just keep running. - *aResult = PR_TRUE; - return NS_OK; - } // Build mutex name from app name. - PR_snprintf( mMutexName, sizeof mMutexName, "%s%s", nameBuffer, MOZ_STARTUP_MUTEX_NAME ); + PR_snprintf( mMutexName, sizeof mMutexName, "%s%s", gAppData->appName, MOZ_STARTUP_MUTEX_NAME ); Mutex startupLock = Mutex( mMutexName ); NS_ENSURE_TRUE( startupLock.Lock( MOZ_DDE_START_TIMEOUT ), NS_ERROR_FAILURE ); @@ -875,7 +866,7 @@ nsNativeAppSupportOS2::StartDDE() { NS_ERROR_FAILURE ); // Allocate DDE strings. - NS_ENSURE_TRUE( ( mApplication = WinDdeCreateStringHandle( mAppName, CP_WINANSI ) ) && InitTopicStrings(), + NS_ENSURE_TRUE( ( mApplication = WinDdeCreateStringHandle( gAppData->appName, CP_WINANSI ) ) && InitTopicStrings(), NS_ERROR_FAILURE ); // Next step is to register a DDE service. diff --git a/toolkit/xre/nsNativeAppSupportWin.cpp b/toolkit/xre/nsNativeAppSupportWin.cpp index 0b8baef96104..4a95d1eb3ef9 100644 --- a/toolkit/xre/nsNativeAppSupportWin.cpp +++ b/toolkit/xre/nsNativeAppSupportWin.cpp @@ -38,6 +38,8 @@ #include "nsNativeAppSupportBase.h" #include "nsNativeAppSupportWin.h" +#include "nsAppRunner.h" +#include "nsXULAppAPI.h" #include "nsString.h" #include "nsICmdLineService.h" #include "nsCOMPtr.h" @@ -318,7 +320,6 @@ private: static HSZ mApplication, mTopics[ topicCount ]; static DWORD mInstance; - static char *mAppName; static PRBool mCanHandleRequests; static PRBool mSupportingDDEExec; static char mMutexName[]; @@ -447,7 +448,7 @@ struct MessageWindow { ::_snprintf( classNameBuffer, sizeof classNameBuffer, "%s%s", - nsNativeAppSupportWin::mAppName, + gAppData->appName, "MessageWindow" ); mClassName = classNameBuffer; } @@ -566,9 +567,6 @@ private: HWND mHandle; }; // struct MessageWindow -static char nameBuffer[128] = { 0 }; -char *nsNativeAppSupportWin::mAppName = nameBuffer; - /* Start: Tries to find the "message window" to determine if it * exists. If so, then Mozilla is already running. In that * case, we use the handle to the "message" window and send @@ -585,6 +583,7 @@ NS_IMETHODIMP nsNativeAppSupportWin::Start( PRBool *aResult ) { NS_ENSURE_ARG( aResult ); NS_ENSURE_TRUE( mInstance == 0, NS_ERROR_NOT_INITIALIZED ); + NS_ENSURE_STATE( gAppData ); if (getenv("MOZ_NO_REMOTE")) { @@ -596,17 +595,9 @@ nsNativeAppSupportWin::Start( PRBool *aResult ) { *aResult = PR_FALSE; // Grab mutex first. - int retval; - UINT id = ID_DDE_APPLICATION_NAME; - retval = LoadString( (HINSTANCE) NULL, id, (LPTSTR) nameBuffer, sizeof(nameBuffer) ); - if ( retval == 0 ) { - // No app name; just keep running. - *aResult = PR_TRUE; - return NS_OK; - } // Build mutex name from app name. - ::_snprintf( mMutexName, sizeof mMutexName, "%s%s", nameBuffer, MOZ_STARTUP_MUTEX_NAME ); + ::_snprintf( mMutexName, sizeof mMutexName, "%s%s", gAppData->appName, MOZ_STARTUP_MUTEX_NAME ); Mutex startupLock = Mutex( mMutexName ); NS_ENSURE_TRUE( startupLock.Lock( MOZ_DDE_START_TIMEOUT ), NS_ERROR_FAILURE ); @@ -733,7 +724,7 @@ nsNativeAppSupportWin::StartDDE() { NS_ERROR_FAILURE ); // Allocate DDE strings. - NS_ENSURE_TRUE( ( mApplication = DdeCreateStringHandle( mInstance, mAppName, CP_WINANSI ) ) && InitTopicStrings(), + NS_ENSURE_TRUE( ( mApplication = DdeCreateStringHandle( mInstance, gAppData->appName, CP_WINANSI ) ) && InitTopicStrings(), NS_ERROR_FAILURE ); // Next step is to register a DDE service.