Jump to content
Sign in to follow this  
MATISZON

Defult browser

Recommended Posts

MATISZON

Can I open any page in which the default search engine?


[size="3"][font="Arial Black"]I'm from the Polish do not as well know how English[/font][/size]

Share this post


Link to post
Share on other sites
lsakizada

Can I open any page in which the default search engine?

#include <GUIConstants.au3>

#include <Misc.au3>

Global $clip

$TheUrl = "http://www.bing.com/search?q=@WORD@&form=QBLH&filt=all"

$TheUrl = StringReplace($TheUrl, "@WORD@", _URIEncode(StringStripWS(StringStripCR($clip),3)))

_LaunchBrowser($TheUrl)

Func _LaunchBrowser($URL)

ShellExecute($URL)

EndFunc

Func _URIEncode($sData)

; Thanks to Prog@ndy

Local $aData = StringSplit(BinaryToString(StringToBinary($sData, 4), 1), "")

Local $nChar

$sData = ""

For $i = 1 To $aData[0]

$nChar = Asc($aData[$i])

Switch $nChar

Case 45, 46, 48 - 57, 65 To 90, 95, 97 To 122, 126

$sData &= $aData[$i]

Case 32

$sData &= "+"

Case Else

$sData &= "%" & Hex($nChar, 2)

EndSwitch

Next

Return $sData

EndFunc ;==>_URIEncode

Edited by lsakizada

Be Green Now or Never (BGNN)!

Share this post


Link to post
Share on other sites
MATISZON

Thanks works :)


[size="3"][font="Arial Black"]I'm from the Polish do not as well know how English[/font][/size]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×