OpenWebPage function

Submit a Bug, or check on a bug status.

OpenWebPage function

Postby onykage on Wed Feb 18, 2009 10:50 pm

function OpenWebpage(in caption:string[*] webpage:string[*]) uses function RegGetBrowser(out BrowserPath:string[*])

HKEY_LOCAL_MACHINE\Software\Classes\htmlfile\shell\open\command

that reg does not return the default browser for windows xp sp3 or Vista, it returns IE only. I called myself looking for the correct location but i didnt find anything useful. Now I know it exists because I have other programs that pull the default in both.
onykage
Admin
 
Posts: 221
Joined: Sat Jan 03, 2009 8:28 pm
Location: Armpit USA
Programming languages: php, java, python, ubercode, easyuo, peril, cobal, pascal, ruby

Re: OpenWebPage function

Postby ubercode on Fri Feb 20, 2009 7:21 pm

well spotted Mike - I take it you have multiple browsers on your PC.

If you know the EXE name of the other browser then you can search the registry for its whereabouts. Eg if you know it's firefox.exe then go into Regedit and search for firefox.exe (may take a few moments). Please tell me if you find the location and I will fix the function. (Also let me know if you're not familiar with Regedit).

I've only got IE here, not for any particular reason but that's how the computer came when I brought it.
ubercode
Site Owner
 
Posts: 274
Joined: Sun Jan 04, 2009 3:46 pm
Location: UK Channel Islands

Re: OpenWebPage function

Postby onykage on Mon Feb 23, 2009 4:05 pm

well,
i found it, its under the user prefs which is under that users userID. Which means to get to this information you have to first figureout what the userID is, then look it up under that ID. I'll research this abit more later once i need it again, and write a function to pull this info out of the reg.

and yes i have 5 different browsers on this pc. And I would strongly urge you to stop using IE, as it allows for so many exploits its not even funny anymore. Not to mention that even the M$ devs themselves dont even use it.
onykage
Admin
 
Posts: 221
Joined: Sat Jan 03, 2009 8:28 pm
Location: Armpit USA
Programming languages: php, java, python, ubercode, easyuo, peril, cobal, pascal, ruby

Re: OpenWebPage function

Postby ubercode on Tue Feb 24, 2009 6:00 pm

If you can find the path including the EXE files that would be great. You can use regedit to export the relevant keys to a text file.
ubercode
Site Owner
 
Posts: 274
Joined: Sun Jan 04, 2009 3:46 pm
Location: UK Channel Islands

Re: OpenWebPage function

Postby onykage on Tue Feb 24, 2009 6:33 pm

ubercode wrote:If you can find the path including the EXE files that would be great. You can use regedit to export the relevant keys to a text file.


I can tell you exactly where its located. Its under the profile id. Problem is, thats a completely unique id that is generated by windows when your desktop is created. So, what i need to do is write a function that pulls your user profile id, then use that id to go to the correct location in the registry to find it.

Its a really simple process really. I'll try to get that function written by the weekend.
onykage
Admin
 
Posts: 221
Joined: Sat Jan 03, 2009 8:28 pm
Location: Armpit USA
Programming languages: php, java, python, ubercode, easyuo, peril, cobal, pascal, ruby

Re: OpenWebPage function

Postby ubercode on Fri May 01, 2009 11:19 pm

Did you find where the default browser was stored? The guid (unique i/d) is likely a red herring, as it will only be the classid of Internet Explorer. There should be another place in the registry where this is kept.
ubercode
Site Owner
 
Posts: 274
Joined: Sun Jan 04, 2009 3:46 pm
Location: UK Channel Islands

Re: OpenWebPage function

Postby onykage on Mon May 04, 2009 4:36 pm

i looked briefly. I know it has to be there cus Ive seen it get called by dozens of other apps. I havnt really dug threw the reg completely. I'll try to make it a point to do so in the near future.
onykage
Admin
 
Posts: 221
Joined: Sat Jan 03, 2009 8:28 pm
Location: Armpit USA
Programming languages: php, java, python, ubercode, easyuo, peril, cobal, pascal, ruby

Re: OpenWebPage function

Postby onykage on Wed Jun 17, 2009 4:50 pm

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

    
//***
    //* @function getDefaultBrowser(caption, href, htype)
    //* @param caption : string : IN : a Error Window caption, {Ubercode Developement Software} is default.
    //* @param href : string : IN : the URL location of the file called.
    //* @param htype : string : IN : static type set, options are (http, https, ftp), {http} is default.
    //*
    //* @useage     first find the default web browser used by the pc user, then find its default location
    //*             on the system disk and call it with some user provided params.
    //***
    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?
onykage
Admin
 
Posts: 221
Joined: Sat Jan 03, 2009 8:28 pm
Location: Armpit USA
Programming languages: php, java, python, ubercode, easyuo, peril, cobal, pascal, ruby

Re: OpenWebPage function

Postby ubercode on Mon Jun 22, 2009 8:06 pm

HKEY_CLASSES_ROOT has the value -2,147,483,648 which is the biggest most negative number. Your program should express this value as

Code: Select all
-2147483647 -1


I just tried a test:

Code: Select all
  call RegGetSettingInfo(-2147483647-1, ".exe", "", ValueData, ValueType)


to bring back the default value of the ".exe" section in the HKEY_CLASSES_ROOT section of the registry. This should work in your current version of Ubercode.
ubercode
Site Owner
 
Posts: 274
Joined: Sun Jan 04, 2009 3:46 pm
Location: UK Channel Islands


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron