- if ( ok )
- {
- // try to send it the DDE request now but ignore the errors
- wxLogNull noLog;
-
- const wxString ddeServer = wxRegKey(keyDDE, wxT("application"));
- if ( wxExecuteDDE(ddeServer, ddeTopic, ddeCmd) )
- return true;
-
- // this is not necessarily an error: maybe browser is
- // simply not running, but no matter, in any case we're
- // going to launch it using ShellExecuteEx() below now and
- // we shouldn't try to open a new window if we open a new
- // browser anyhow
- }
- }
- }
- }
-#endif // wxUSE_IPC
-
- WinStruct<SHELLEXECUTEINFO> sei;
- sei.lpFile = url.c_str();
- sei.lpVerb = _T("open");
- sei.nShow = SW_SHOWNORMAL;
-
- ::ShellExecuteEx(&sei);
-
- const int nResult = (int) sei.hInstApp;
-
- // Firefox returns file not found for some reason, so make an exception
- // for it
- if ( nResult > 32 || nResult == SE_ERR_FNF )
- {
-#ifdef __WXDEBUG__
- // Log something if SE_ERR_FNF happens
- if ( nResult == SE_ERR_FNF )
- wxLogDebug(wxT("SE_ERR_FNF from ShellExecute -- maybe FireFox?"));
-#endif // __WXDEBUG__
- return true;
- }
-#elif defined(__WXCOCOA__)
- // NOTE: We need to call the real implementation from src/cocoa/utils.mm
- // because the code must use Objective-C features.
- return wxCocoaLaunchDefaultBrowser(url, flags);
-#elif defined(__WXMAC__)
- OSStatus err;
- ICInstance inst;
- long int startSel;
- long int endSel;
-
- err = ICStart(&inst, 'STKA'); // put your app creator code here
- if (err == noErr)
- {
-#if !TARGET_CARBON
- err = ICFindConfigFile(inst, 0, NULL);
-#endif
- if (err == noErr)
- {
- ConstStr255Param hint = 0;
- startSel = 0;
- endSel = url.length();
- err = ICLaunchURL(inst, hint, url.fn_str(), endSel, &startSel, &endSel);
- if (err != noErr)
- wxLogDebug(wxT("ICLaunchURL error %d"), (int) err);
- }
- ICStop(inst);
- return true;
- }
- else
- {
- wxLogDebug(wxT("ICStart error %d"), (int) err);
- return false;
- }