Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

BOOL PURL::OpenBrowser ( const PString url  )  [static]

Open the URL in a browser.

Returns:
The browser was successfully opened. This does not mean the URL exists and was displayed.
Parameters:
url  URL to open

Definition at line 1205 of file http.cxx.

References PProcess::Current().

{
#ifdef WIN32
  SHELLEXECUTEINFO sei;
  ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
  sei.cbSize = sizeof(SHELLEXECUTEINFO);
  sei.lpVerb = TEXT("open");
 #ifndef _WIN32_WCE
   sei.lpFile = url;
 #else
   USES_CONVERSION;
   sei.lpFile = A2T(url);
 #endif // _WIN32_WCE

  if (ShellExecuteEx(&sei) != 0)
    return TRUE;

#ifndef _WIN32_WCE
  MessageBox(NULL, "Unable to open page"&url, PProcess::Current().GetName(), MB_TASKMODAL);
#else
  MessageBox(NULL, _T("Unable to open page"), A2T(PProcess::Current().GetName()), MB_APPLMODAL);
#endif // _WIN32_WCE

#endif // WIN32
  return FALSE;
}


Generated by  Doxygen 1.6.0   Back to index