Jump to content

Button to search google


 Share

Recommended Posts

So I have a auto search engienr that first would execute a website url, now I made a radio button to choose between searching google, and going directly to the URL. I am having troubles though, the URL search works perfect but when I try and search google it bugs and says "Error in expression" Here is what I have for the function:

Func _Action()
    Local $URL2, $Search2
    If GUICtrlRead($Radio2) = 1 Then
        $URL2 = ShellExecute(GUICtrlRead($Input1))
    Else
        $Search2 = ShellExecute("www.google.com/search?hl=en&client=firefox-a&channel=s&rls=org.mozilla%3Aen-US%3Aofficial&hs=pF2&q="GUICtrlRead($Input1)"&aq=f&oq=&aqi=")
    EndIf
EndFunc

Now I am not aware of a different way to search for google other than using the URL and inputting what I am searching for some my first question is, is that all I can do for searching?

My second question is, If it is, how do I make it work for all web browsers? Obviously this will only work if Firefox is installed on the computer. Please help, thanks!

Link to comment
Share on other sites

I could be wrong..but pretty sure this..

$Search2 = ShellExecute("www.google.com/search?hl=en&client=firefox-a&channel=s&rls=org.mozilla%3Aen-US%3Aofficial&hs=pF2&q="GUICtrlRead($Input1)"&aq=f&oq=&aqi=")

should look like this...

$Search2 = ShellExecute("www.google.com/search?hl=en&client=firefox-a&channel=s&rls=org.mozilla%3Aen-US%3Aofficial&hs=pF2&q="&GUICtrlRead($Input1)&"&aq=f&oq=&aqi=")

EDIT: Also, i thought shellexecute opens the link in the default browser, so if thats firefox, it will open it in there, otherwise it will open it up in whatever other program the person uses!

Edited by furrycow
Instant Lockerz Invite - www.instantlockerzinvite.co.uk
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...