From: sln Date: Mon, 20 Oct 2008 13:15:42 +0000 (+0000) Subject: Launching default browser for viewing help on WNT platform X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f5a417a74d50b24337dc7e476e1c20ada339c024;p=modules%2Fgui.git Launching default browser for viewing help on WNT platform --- diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 47bbb1290..0edfc2fd1 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -26,6 +26,10 @@ #include #endif +#ifdef WIN32 +#include +#endif + #include "LightApp_Application.h" #include "LightApp_Module.h" #include "LightApp_DataModel.h" @@ -905,6 +909,20 @@ void LightApp_Application::onHelpContentsModule() QString quote("\""); anApp.prepend( quote ); anApp.append( quote ); + + if ( anApp.isEmpty() || anApp == "\"\"" ) + { + // try to find default browser + HRESULT hr; + static const int aLen = MAX_PATH + 100; + TCHAR szExe[ aLen ]; + DWORD cchExe = sizeof( TCHAR ) * aLen; + if ( SUCCEEDED(hr = AssocQueryString(0, ASSOCSTR_COMMAND, + TEXT(".html"), TEXT("open"), szExe, &cchExe))) + { + anApp = szExe; + } + } #endif QString aParams = resMgr->stringValue("ExternalBrowser", "parameters");