X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2190f6aa153416d1c225532bb026df98b3e273ad..2cce66352fc23859e991c2e7658dbf1cdf8c4183:/src/common/utilscmn.cpp diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 05bb209f57..85e35c5082 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -436,8 +436,7 @@ bool wxGetEmailAddress(wxChar *address, int maxSize) if ( !email ) return false; - wxStrncpy(address, email, maxSize - 1); - address[maxSize - 1] = wxT('\0'); + wxStrlcpy(address, email.t_str(), maxSize); return true; } @@ -960,16 +959,21 @@ bool wxLaunchDefaultApplication(const wxString& document, int flags) return true; } #elif defined(__WXMSW__) - const INT_PTR result = (INT_PTR)::ShellExecute - ( - NULL, // parent window - _T("open"), - document.wx_str(), - NULL, // parameters - NULL, // working directory - SW_SHOWDEFAULT - ); - if ( result > 32 ) + WinStruct sei; + sei.lpFile = document.wx_str(); + sei.lpVerb = _T("open"); +#ifdef __WXWINCE__ + sei.nShow = SW_SHOWNORMAL; // SW_SHOWDEFAULT not defined under CE (#10216) +#else + sei.nShow = SW_SHOWDEFAULT; +#endif + + // avoid Windows message box in case of error for consistency with + // wxLaunchDefaultBrowser() even if don't show the error ourselves in this + // function + sei.fMask = SEE_MASK_FLAG_NO_UI; + + if ( ::ShellExecuteEx(&sei) ) return true; #endif