]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Launching default browser for viewing help on WNT platform
authorsln <sln@opencascade.com>
Mon, 20 Oct 2008 13:15:42 +0000 (13:15 +0000)
committersln <sln@opencascade.com>
Mon, 20 Oct 2008 13:15:42 +0000 (13:15 +0000)
src/LightApp/LightApp_Application.cxx

index 47bbb1290b46435d7ff09e21797fb5c0d57d4129..0edfc2fd1d0358d04ca2c73c5c7018815a21f099 100644 (file)
   #include <PyConsole_Console.h>
 #endif
 
+#ifdef WIN32
+#include<shlwapi.h>
+#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");