Показать сообщение отдельно
Старый 28.06.2007, 14:17   #1  
EVGL is offline
EVGL
Banned
Соотечественники
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
 
4,445 / 3001 (0) ++++++++++
Регистрация: 09.07.2002
Адрес: Parndorf, AT
If iexplore.exe suxx...
X++:
    // I use Firefox ;-)
    handle = WinAPI::regOpenKey(#HKEY_CURRENT_USER, 'SOFTWARE\\Classes\\HTTP\\shell\\open\\command', #KEY_READ);
    if (! handle)
        handle = WinAPI::regOpenKey(#HKEY_CLASSES_ROOT, 'HTTP\\shell\\open\\command', #KEY_READ);
    if (handle)
    {
        regValue = WinAPI::regGetValue(handle, '');
        if (regValue && typeOf(conpeek(regValue, 1)) == Types::String)
            browserPath = conpeek(regValue, 1); // like "C:\Programme\Internet Explorer\IEXPLORE.EXE" -nohome
                                                // or   C:\PROGRA~1\MOZILL~1\FIREFOX.EXE -url "%1" -requestPending

        // cut off the optional command-line parameters
        quoteOpenPos = strfind(browserPath, '\"', 1, strlen(browserPath));
        quoteClosPos = strfind(browserPath, '\"', quoteOpenPos+1, strlen(browserPath));
        if (quoteOpenPos == 1 && quoteClosPos)
        {
            browserPath = substr(browserPath, quoteOpenPos, quoteClosPos-quoteOpenPos+1);
        }
        else
        {
            browserPath = strrem(browserPath, '\"');
            // from the beginning till the first space before a parameter
            do
            {
                spacePos = strfind(browserPath, ' ', spacePos+1, strlen(browserPath));
            }
            while(spacePos && strfind(browserPath, '\\.', spacePos+1, strlen(browserPath)));

            if (spacePos)
                browserPath = substr(browserPath, 1, spacePos-1);
        }
    }
    if (! browserPath)
        browserPath = #IEXPLORE_PATH;

    WinAPI::shellExecute(browserPath, url);
}
За это сообщение автора поблагодарили: gl00mie (2).