Jump to content
Sign in to follow this  
zcoacoaz

SearchBar

Recommended Posts

zcoacoaz

SearchBar1.18

SearchBar is a small red bar that floats anywhere you want on your screen. It can search on Google, Ask, Yahoo or a search engine you specify yourself.

  • Search Switches/Parameters:
  • /c (search) - Search your computer for a file (does not work completely) (C:\*.txt)
  • /p (search) - Search for images on your selected search engine (/p monkeys)
  • /d (word) - Search on dictionary.com for a definition (/d Eskimo)
  • /w (word) - Search on dictionary.com for a definition (/w Eskimo)
  • /hotkeyoff - Turn off the Ctrl+Alt+S hotkey
  • /hotkeyon - Turn on the Ctrl+Alt+S hotkey
  • /help - Open a help window (not much information in it)
Screenshots:

SearchBar

Posted Image

---------------

Configuration

Posted Image

---------------

Custom Search Engine

Posted Image

Edit9: Version 1.18 Added images to the buttons /hotkeyon and /hotkeyoff commands /help command and i made it compatible with the current AutoIt release

Edit8: Version 1.14 Code optimization, crappy computer searching and updates to the GUI, this was meant to be a real cool release but i kinda couldn't figure forum searching

Edit7: Version 1.09 i fixed the issue with multiple history items did some minor changes and added an option to use a custom search engine

Edit6: Version 1.07 i added the ability to put /w or /d before your search to search dictionary.com

Edit5: Version 1.06 there is a "Clear History" button now and there are some other updates.

Edit4: Version 1.04 there is now a limit on memory items

Edit3: Fixed bug where it turns a + into a space

Edit2: Minor updates and added combo box

Edit1: Added screenshots

SearchBar.zip

Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites
Insolence

VERY cool :)

Nicely done.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
Guido

Good Cool Job Script. :):D:D:(:huh:

Every other word.


I used to have over 700 posts. This is a new account. I am not a newbie.My AutoIt Home Page - Here is all my AutoIt stuff. Well, actually, I have loads more, I am just too lazy to put it on my page right now so deal with it.Guess what? The unvierse is made out of basically nothing.Think about it? What is the smallest building block of anything, it is what? A chunk of nothingness. Thats all. Hey this peice of space is a forperborb and it is so.

Share this post


Link to post
Share on other sites
zcoacoaz

right now im working on implementing a combo box that removes duplicate entrys and has a custom number of items to remember


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites
buzz44

bug?

Posted Image

i typed "/p this didnt work" into the input box

Edited by burrup

qq

Share this post


Link to post
Share on other sites
zcoacoaz

i think you can fix that by going to the config dialog then clicking save

edit: i'm updating it right now so no one else has this problem

Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites
zcoacoaz

I've fixed the bug with the images and one where it converts a + to a space. So far the combo box doesn't remove duplicate entrys or limit entrys but i will hopefully do it soon.

Edit: The limit now works :)

Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites
Ejoc

Nice.

What about adding a clear history option in the config menu?


Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs

Share this post


Link to post
Share on other sites
zcoacoaz

good idea, i will add that soon :)


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites
buzz44

thx for fixing bug =), work great, i think the history idea is good aswell


qq

Share this post


Link to post
Share on other sites
zcoacoaz

There seems to be a bug with the history where it adds entrys multiple times. I will fix it as soon as possible.


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites
zcoacoaz

Two new versions, see the first post for information.


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites
zcoacoaz

i think i will add a /c switch to search your computer also.


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites
buzz44

found and fixed some minor bugs =)

you can have multiple config windows but only one will exit =(

change config() to

Func Config()
   If Not WinExists("SearchBar Configuration")
    $Config = GUICreate("SearchBar Configuration", 300, 248)
    GUISetBkColor(0xFFFFFF)
    GUISetOnEvent($GUI_EVENT_CLOSE, "NoConfig")
    GUICtrlCreateGroup("Posistioning", 3, 3, 70, 70)
    GUICtrlCreateLabel("X", 10, 26, 10, 20)
    $X = GUICtrlCreateInput(RegRead("HKCU\Software\Xenogis\SearchBar", "X"), 24, 26, 40, 20)
    GUICtrlCreateLabel("Y", 10, 49, 10, 20)
    $Y = GUICtrlCreateInput(RegRead("HKCU\Software\Xenogis\SearchBar", "Y"), 24, 49, 40, 20)
    GUICtrlCreateLabel("Fading Speed", 120, 10, 80, 20)
    GUICtrlCreateLabel("Slow", 77, 30, 30, 25)
    $Fading = GUICtrlCreateSlider(100, 30, 160, 20)
    GUICtrlSetLimit(-1, 20, 1)
    GUICtrlSetData(-1, RegRead("HKCU\Software\Xenogis\SearchBar", "Fading"))
    GUICtrlCreateLabel("Instant", 263, 30, 50, 20)
    GUICtrlCreateLabel("Max num. of items to remember", 100, 55, 200, 20)
    $MaxItems = GUICtrlCreateInput(RegRead("HKCU\Software\Xenogis\SearchBar", "Memory Length"), 175, 75, 50, 20)
    GUICtrlCreateButton("Clear History", 120, 100, 100, 25)
    GUICtrlSetOnEvent(-1, "ClearHistory")
    $Google = GUICtrlCreateRadio("", 3, 120, 20, 20)
    GUICtrlCreatePic("google.gif", 26, 120, 73, 32)
    $Yahoo = GUICtrlCreateRadio("", 3, 152, 20, 20)
    GUICtrlCreatePic("yahoo.gif", 26, 152, 93, 32)
    $Ask = GUICtrlCreateRadio("", 3, 184, 20, 20)
    GUICtrlCreatePic("ask.gif", 26, 184, 93, 32)
    $Custom = GUICtrlCreateRadio("Custom", 3, 216, 50, 20)
    $CustomInput = GUICtrlCreateButton("Set", 56, 216, 50, 20)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUICtrlSetOnEvent(-1, "CustomInput")
    GUICtrlCreateButton("Default", 249, 220, 50, 25)
    GUICtrlSetOnEvent(-1, "DefaultConfig")
    GUICtrlCreateButton("Save", 196, 220, 50, 25)
    GUICtrlSetOnEvent(-1, "SaveConfig")
    GUICtrlCreateButton("Close", 143, 220, 50, 25)
    GUICtrlSetOnEvent(-1, "NoConfig")
    If RegRead("HKCU\Software\Xenogis\SearchBar", "Search") = "http://www.google.com/search?q=" Then
        GUICtrlSetState($Google, $GUI_CHECKED)
    ElseIf RegRead("HKCU\Software\Xenogis\SearchBar", "Search") = "http://www.ask.com/web?q=" Then
        GUICtrlSetState($Ask, $GUI_CHECKED)
    ElseIf RegRead("HKCU\Software\Xenogis\SearchBar", "Search") = "http://search.yahoo.com/search?p=" Then
        GUICtrlSetState($Yahoo, $GUI_CHECKED)
    Else
        GUICtrlSetState($Custom, $GUI_CHECKED)
    EndIf
    GUISetState()
   EndIf
EndFunc

easy enough , and you can run multiple instances of it and all the windows overlap, so to make sure there is only one running at any given time make this the very first If statment , above the regread one

If WinExists("Xen's SearchBar 1.0") Then
   Exit
EndIf

and i was gonna add a little bit so it fades in when u run it, but i had a previous version and i just d loaded your new version and u already did it! great minds think alike =)

hope dont mind about bug fixing :)

edit: you latest version, i cant type in the input box , help :D

edit2: figured out wat was wrong lol, i hadnt used "config" and told it wat websites..

i recommend you already have google or yahoo as the default instead of nothing

edit3:

one more bug, opens multiple custom search windows =), just add and if statment again

Func CustomInput()
   If Not WinExists("Custom Search") Then
    $CustomConfig = GUICreate("Custom Search", 156, 79, -1, -1, BitOR($WS_BORDER, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU))
    GUISetOnEvent($GUI_EVENT_CLOSE, "NoCustomInput")
    GUICtrlCreateLabel("Search", 3, 3, 50, 20)
    $CustomSearch = GUICtrlCreateInput("", 50, 3, 100, 20)
    GUICtrlCreateLabel("Images", 3, 26, 50, 20)
    $CustomImage = GUICtrlCreateInput("", 50, 26, 100, 20)
    GUICtrlCreateButton("Okay", 3, 51, 50, 25)
    GUICtrlSetOnEvent(-1, "SaveCustom")
    GUISetState()
   EndIf
EndFunc

edit4:you said in previous post that the history addes multiple entry's, did you fix this ? cause say if u have maximum history for 2.. i search for "aaa" and its fine but when it reaches the last maximum history search it doubles ... eg ... say i search for "aaa" then "bbb" and the max history is 2 the combo box will display

bbb

aaa

bbb

aaa

and then if i search for "ccc" it will be

ccc

bbb

aaa

ccc

bbb

sorry if you already knew that but just wanted to make sure =)

btw I THINK ITS GREAT! i really like the use of transparency you used :huh:

edit5: last one i swear =), i "fixed" the multiple history thing but it still needs debuggin lol

Func Search()
    $S = GUICtrlRead($Search)
    RegWrite("HKCU\Software\Xenogis\SearchBar", "Memory", "REG_SZ", $S & "|" & RegRead("HKCU\Software\Xenogis\SearchBar", "Memory"))
    GUICtrlSetData($Search, RegRead ("HKEY_CURRENT_USER\Software\Xenogis\SearchBar", "Memory"))
    $SC = StringReplace(GUICtrlRead($Search), "+", "%2B")
    $SC = StringReplace($SC, " ", "+")
    GUICtrlSetData($Search, "Searching...", "Searching...")
    GUICtrlSetState($Search, $GUI_DISABLE)
    GUICtrlSetState(4, $GUI_DISABLE)
    If StringLeft($S, 3) = "/p " Then
        $Engine = RegRead("HKCU\Software\Xenogis\SearchBar", "Images")
        $SearchString = StringTrimLeft($SC, 3)
    ElseIf StringLeft($S, 3) = "/d " Or StringLeft($S, 3) = "/w " Then
        $Engine = "http://dictionary.reference.com/search?q="
        $SearchString = StringTrimLeft($SC, 3)
    Else
        $Engine = RegRead("HKCU\Software\Xenogis\SearchBar", "Search")
        $SearchString = $SC
    EndIf
    RunWait(@ComSpec & ' /c start ' & $Engine & $SearchString, "", @SW_HIDE)
    $ExHWND = WinGetHandle("")
    While 1
        If Not StringInStr(StatusbarGetText($ExHWND), "Loading") And Not StringInStr(StatusbarGetText($ExHWND), "Connecting") Then
            If Not StringInStr(StatusbarGetText($ExHWND), "Downloading") And Not StringInStr(StatusbarGetText($ExHWND), "Opening") Then
                If Not StringInStr(StatusbarGetText($ExHWND), "Reading") Then ExitLoop
            EndIf
        EndIf
    WEnd
    $SearchData = $SearchData & $S
    GUICtrlSetData($Search, "")
    GUICtrlSetState($Search, $GUI_ENABLE)
    GUICtrlSetState(4, $GUI_ENABLE)
EndFunc

edit6: one more thing lol :D , i cant find anywhere in your code where it sets the max history length, it saves it to the registry but where does the combo box set?.. because above the history code works fine . eg say i had max history 4 there will be 3 entries. as soon as the 4th search is entered that is why it goes funny and i dont know who cause in the search() function i cant find anything do to with $maxitems or

Edited by burrup

qq

Share this post


Link to post
Share on other sites
buzz44

^^ ran outta space lol

___

with $maxitems or reading the reg value "memory lenghth", help would be much appreciated


qq

Share this post


Link to post
Share on other sites
zcoacoaz

thank you burrup :) some of the stuff you did i had already done but not realeased yet

edit: i won't use the status bar reader part because all browsers don't work the same

edit2: i will fix the bug where it keeps 1 less history item

edit3: about the items doubling that is because i forgot to make it clear the data before setting it to the new data

Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites
buzz44

thats great! :) , yer i wasnt sure if u might of had that already but i think ur script is really cool and wanted to help =), sry if i came off as a code war thing


qq

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.