sjorrel Posted April 6, 2005 Posted April 6, 2005 (edited) I'd like to create a button/link that opens a web page in the user's default browser. I know I could just use the run command and iexplore.exe - but what if internet explorer isn't installed on that machine? Is there any way of calling the default browser for that machine? edit: sorry - just realised there is a similar topic a few questions down - i would delete this post and put the question there, but i don't think thats possible Edited April 6, 2005 by sjorrel
kjactive Posted April 6, 2005 Posted April 6, 2005 (edited) You could use CWebPage.dll to build up your own browser in a window, I did a lot of work with this library and sampled all on a page, a lot of examples included and all free to download from...http://www.sitecenter.dk/latenight/Kåre Edited April 6, 2005 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc...
Ejoc Posted April 6, 2005 Posted April 6, 2005 Create a text file like this: [InternetShortcut] URL=http://www.autoitscript.com/forum/index.php?showtopic=10190 Name it w/ the extension .URL use the filename.url in a run(@comspec) Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
Ejoc Posted April 6, 2005 Posted April 6, 2005 A complete example: #include <file.au3> $URL = "http://www.autoitscript.com/forum" $fd = FileOpen(@TEMPDir & "url.url",2) if $fd = -1 Then Exit FileWriteLine($fd,"[InternetShortcut]") FileWriteLine($fd,"URL=" & $URL) FileClose($fd) Run(@comspec & " /c " & chr(34) & @TEMPDir & "url.url" & chr(34)) Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
Green_Lantern Posted April 20, 2005 Posted April 20, 2005 This solution doesn't require the extra file. $url = "http://google.com" Run(@comspec & " /c start " & $url, "", @SW_HIDE) DreamHost: great web hosting for as little as $7.95 a month.
kjactive Posted April 20, 2005 Posted April 20, 2005 (edited) Well this solution is only if you want to use your own browser but here is an example on open your wanted site with CWebPage library... $dll = DLLOpen("cwebpage.dll") $hwnd = GUICreate("MediePlayer...",800,600,-1,-1) DLLCall($dll,"long","EmbedBrowserObject","hwnd",$hwnd) GUISetState() DLLCall($dll,"long","DisplayHTMLPage","hwnd",$hwnd,"str","http://www.autoitscript.com/forum") While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop WEnd $ret = DLLCall($dll,"long","UnEmbedBrowserObject","hwnd",$hwnd) Exit Func OnAutoItExit() DLLClose($dll) EndFunc This is a very nice library from Jeff Glatt, an old computer guru from the R.I.P. Amiga days... Kåre Edited April 20, 2005 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc...
w0uter Posted April 23, 2005 Posted April 23, 2005 or use com $o_URL = ObjCreate("Shell.Application") $o_URL.Open($s_URL) you need the 3.1.1++ vesion for COM support My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now