Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/functions_content.php on line 661

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/functions_content.php on line 661

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/functions_content.php on line 661

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/functions_content.php on line 661
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3729: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:112)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3731: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:112)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3732: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:112)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3733: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:112)
ubercode.com • View topic - DefaultBrowser function

DefaultBrowser function

Make suggestions of things to add or change in Ubercode.

DefaultBrowser function

Postby onykage on Tue Jun 23, 2009 2:43 pm

Ok,

this works. Maybe this can be implemented into the full UC program at a later date. In the mean time, anyone who wants to get the default browser on a computer this function will get it.

Code: Select all

    
//***
    //* @function getDefaultBrowser(caption, href, htype)
    //* @param caption : string : IN : a Error Window caption.
    //* @param href : string : IN : the URL location of the file called.
    //* @param htype : string : IN : static type set, options are (http, https, ftp).
    //*
    //* @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 
// just in case
                userchoice <- RegGetSetting(HKEY_CURRENT_USER,
                "Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice",
                "Progid")
            end if
            filelocation 
<- RegGetSetting(-2147483647-1, 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
  
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

Return to Language Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron