Página 1 de 1

[AUTOIT]GetBrowser

Publicado: 27 Jul 2014, 06:29
por Scorpio
Bueno, esta es una función que usaba en la SafeLoader 1.0 y la he traducido por necesidad.
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.8.1
 Author: Scorpio

 Script Function:
	Get the system default browser.

#ce ----------------------------------------------------------------------------

MsgBox(16, "Test", GetBrowser())

Func GetBrowser()
    $Value = RegRead("HKEY_CLASSES_ROOT\HTTP\shell\open\command\", "")
    $Value = StringLeft($Value, StringInStr($Value, ".exe") + 4)
	Return $Value
EndFunc
//Regards.

Re: [AUTOIT]GetBrowser

Publicado: 27 Jul 2014, 15:37
por Pink
Muy Buena la funcion :)

aqui dejo una alternativa.
;Pink
MsgBox(0,"Default Broswer",GetDefaultBroswer())

Func GetDefaultBroswer()
Local Const $ASSOCSTR_EXECUTABLE=0x2
Local Const $shttp = 'http'

Local $hRet = DllCall('shlwapi.dll', 'long', 'AssocQueryStringW', 'dword', 0, 'dword', $ASSOCSTR_EXECUTABLE, 'wstr', $shttp, _
			"wstr", Null, 'wstr', '', 'dword*', Null)

Local $tPath=DllStructCreate("wchar[" & $hRet[6] & "]")
$hRet = DllCall('shlwapi.dll', 'long', 'AssocQueryStringW', 'dword', 0, 'dword', $ASSOCSTR_EXECUTABLE, 'wstr', $shttp, _
			"wstr", Null, 'ptr', DllStructGetPtr($tPath), 'dword*', $hRet[6])
Return DllStructGetData($tPath,1)

EndFunc
Saludos

Re: [AUTOIT]GetBrowser

Publicado: 27 Jul 2014, 18:12
por Blau
Muy buenas, me las guardo.

EDIT:

He hecho mi versión

Código: Seleccionar todo

Func GetBrowser3()
    Return RegRead("HKEY_CURRENT_USER\Software\Clients\StartMenuInternet", "")
EndFunc

Re: [AUTOIT]GetBrowser

Publicado: 27 Jul 2014, 18:47
por Scorpio
Jajaja, me encanta esto, hay que darle duro chicos!

//Regards.

Re: [AUTOIT]GetBrowser

Publicado: 27 Jul 2014, 22:14
por _ROOTt_