ok, i wrote a function that gets the default browser and its location, now, there are some issues tho.
first issue,
- Code: Select all
//system.cls : line 1897
public const
HKEY_CURRENT_USER:integer
HKEY_LOCAL_MACHINE:integer
HKEY_USERS:integer
REG_BINARY:integer
REG_DWORD:integer
REG_DWORD_BIG_ENDIAN:integer
REG_EXPAND_SZ:integer
REG_LINK:integer
REG_MULTI_SZ:integer
REG_RESOURCE_LIST:integer
REG_SZ:integer
HKEY_CLASS_ROOT:integer is needed.
also
- Code: Select all
//system.cls : line 4713
public const
HKEY_CURRENT_USER:integer <- 0x80000001
HKEY_LOCAL_MACHINE:integer <- 0x80000002
HKEY_USERS:integer <- 0x80000003
REG_BINARY:integer <- 3
REG_DWORD:integer <- 4
REG_DWORD_BIG_ENDIAN:integer <- 5
REG_EXPAND_SZ:integer <- 2
REG_LINK:integer <- 6
REG_MULTI_SZ:integer <- 7
REG_RESOURCE_LIST:integer <- 8
REG_SZ:integer <- 1
HKEY_CLASS_ROOT:integer <- ????
if you fix that then this function should retrieve the default browser, its location, and do exactly what openWebpage() does.
- Code: Select all
public function getDefaultBrowser(in caption:string[*] href:string[*] htype:string[*])
var
userchoice : string[*]
filelocation : string[*]
code
if htype /= "" then
if htype = "http" then
userchoice <- RegGetSetting(HKEY_CURRENT_USER,
"Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice",
"Progid")
end if
if htype = "https" then
userchoice <- RegGetSetting(HKEY_CURRENT_USER,
"Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice",
"Progid")
end if
if htype = "ftp" then
userchoice <- RegGetSetting(HKEY_CURRENT_USER,
"Software\Microsoft\Windows\Shell\Associations\UrlAssociations\ftp\UserChoice",
"Progid")
end if
else
userchoice <- RegGetSetting(HKEY_CURRENT_USER,
"Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice",
"Progid")
end if
filelocation <- RegGetSetting(HKEY_CLASS_ROOT, userchoice+"\shell\open\command", "")
if Filesize(filelocation) <= 0 then
call MsgBox(caption,
"Opps, the file supplied does no exist.")
end if
call exec(filelocation, href, exec_nowait+sw_shownormal)
end function
How hard would it be to add this in, and how long till the next version of UC?