Parametry:
-szlink - adres URL strony
-bLog - zapis do pliku log
Wartości zwracane: true/false;
function BOOL StartWebPage(szlink, bLog)
LIST listSubKeys;
STRING KLUCZ, sKey;
NUMBER nReturn, nType, nSize;
BOOL bResult;
begin
if (bLog) then WriteLog(0,"* Uruchomienie przeglądarki ze stroną:"+szlink); endif;
bResult = FALSE;
RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
KLUCZ = "http\\shell\\open\\command";
if (RegDBGetKeyValueEx(KLUCZ, "", nType , sKey, nSize )=0 ) then
StrReplace(sKey,'"','',0);
if (StrFind(sKey,"exe")>0) then
StrSub(sKey, sKey,0,StrFind(sKey,"exe")+3);
endif;
sKey = '"' + sKey + '"';
if (LaunchApplication (sKey, szlink, "", SW_NORMAL, 0, LAAW_OPTION_USE_SHELLEXECUTE |
LAAW_OPTION_NOWAIT | LAAW_OPTION_SHOW_HOURGLASS)== ISERR_SUCCESS ) then
//if LaunchApp(sKey, szlink)=0 then
bResult = TRUE;
if (bLog) then WriteLog(2,"-uruchomiono"); endif;
else
if (bLog) then
WriteLog(2,"-nie udało się uruchomić przeglądarki");
WriteLog(2," polecenie: "+sKey+", parametr: "+szlink);
endif;
endif;
else
if (bLog) then WriteLog(1,"- nie mogę odczytać klucza: HKEY_CLASSES_ROOT\\"+ KLUCZ); endif;
endif;
return bResult;
end;
Brak komentarzy:
Prześlij komentarz