

[*:2hzcv74e]Use Hotkey Ctrl+Alt+g to Hide/Show GUI. To exit, use TrayIcon
[*:2hzcv74e]I'm Feeling Lucky is default. To view Google site search results - Keep LCtrl down while clicking a button.
[*:2hzcv74e]The first button is the default button.
[*:2hzcv74e]Empty buttons ( to maintain symmetry ) will be tolerated. Use || to create empty buttons
[*:2hzcv74e]To adjust Bitmap size, pass W & H to Params 4 & 5 in LoadImage() call.
[color=#225599]/* _____ _______ ______ _
gifl.ahk, Google [ I'm Feeling Lucky ] Site Search (_____)(_______)(______)(_) 46L
(_) ___ (_) (_)__ (_)
Created: 14-Aug-2012 / Last Modified: 14-Aug-2012 (_) (___) (_) (____) (_)
SKAN ( A.N.Suresh Kumar, arian.suresh@gmail.com ) (_)___(_)__(_)__ (_) (_)____
www.autohotkey.com/community/viewtopic.php?t=90096 (_____)(_______)(_) (______)
*/[/color]
#SingleInstance, Force
SetWorkingDir %A_ScriptDir%
IfNotExist, gifl.ico, URLDownloadToFile, http://www.google.com/favicon.ico, gifl.ico
Menu, Tray, UseErrorLevel
Menu, Tray, Icon, gifl.ico, 1
ButtonW := [color=#FF0000]96[/color], ButtonH := [color=#FF0000]32[/color], ButtonSpacing := [color=#FF0000]3[/color], BPR := ButtonsPerRow := [color=#FF0000]5[/color]
Sites= [color=#008000]; ButtonText/BMP | SearchSiteURL | ExtraSearchInfo[/color]
( [color=#008000]; ----------------+-----------------------------------------------+----------------[/color]
&IMDb | imdb.com/title |
&OpenSubtitles | opensubtitles.org/en/search/sublanguageid-eng |
The&TVDb | thetvdb.com/?tab=series&id | +series+info
Addic&7ed | addic7ed.com/show |
TV&Subtitles | www.tvsubtitles.net/tvshow |
&AutoHotkey | autohotkey.com |
&MSDN | msdn.microsoft.com/en-us/library |
&Wikipedia | en.wikipedia.org/wiki |
&Dictionary | dictionary.reference.com/browse |
&UrbanDict | urbandictionary.com/define.php?term= |
) [color=#008000]; ----------------^-----------------------------------------------^----------------[/color]
StringSplit, BTN, Sites, `n, %A_Space%
Gui +AlwaysOnTop +LastFound
hGui := WinExist()
Gui, Font, S10, Arial
Gui, Add, Edit, % "hwndhEdit vSearch xm w" ( ButtonW * BPR ) + ( (BPR-1) * ButtonSpacing )
Loop % ( BTN0 ) {
Coord := Mod( A_Index,BPR ) = 1 ? "xm y+" ButtonSpacing : "yp x+" ButtonSpacing
StringSplit, Par, BTN%A_Index%, |, %A_Space%
Gui, Add, Button, %Coord% w%ButtonW% h%ButtonH% vBTN%A_Index% hwndID gGoogleIFL, %Par1%
If FileExist( BMP := RegExReplace( Par1, "&" ) ".bmp" ) {
Control, Style, +0x80, , ahk_id %ID%
hBM := DllCall( "LoadImage", UInt,0, Str,BMP, Int,0, Int,0, Int,0, UInt,0x2010, UInt )
SendMessage, 0xF7, 0x0, %hBM% ,, ahk_id %ID% [color=#008000]; BM_SETIMAGE > IMAGE_BITMAP[/color]
} GuiControl, +Default, Button1 [color=#008000]; Flag the first Button as default[/color]
} Gui, Show, AutoSize, Google Site Search [ I'm Feeling Lucky ]
[color=#FF0000]^!g::[/color]GoSub, GuiEscape [color=#008000]; // end of auto-execute section //[/color]
[color=#FF2000]GoogleIFL:[/color]
StringSplit, Par, %A_GuiControl%, |, %A_Space%
GuiControlGet, Search
If ! ( Search="" || Par1="" )
Run, % """http://www.google.com/search?" ( ! GetKeyState( "LControl" ) ? "sourceid="
. "navclient&btnI&" : "" ) "q=" Search ( Par3<>"" ? Par3 : "" ) "+site:" Par2 . """"
[color=#FF2000]GuiEscape:[/color]
GuiControl, Focus, Search
SendMessage, 0xB1, 0, -1, Edit1, ahk_id %hGUI% [color=#008000]; EM_SETSEL > Select All[/color]
Gui, Show, % ( DllCall( "IsWindowVisible", UInt,hGui ) ? "Hide" : "" )
Optional:
:arrow: If a Bitmap matching the 'ButtonText' is found in the 'Script Folder', it will be automatically applied to the button.
The following 10 bitmaps ( alphabetical order ) are sized 92x32 ( 8bit, 4022 bytes each )
http://dl.dropbox.com/u/6428211/AutoHotkey/GIFL/Addic7ed.bmp http://dl.dropbox.co.../AutoHotkey.bmp http://dl.dropbox.co.../Dictionary.bmp http://dl.dropbox.co...y/GIFL/IMDb.bmp http://dl.dropbox.co...y/GIFL/MSDN.bmp
http://dl.dropbox.com/u/6428211/AutoHotkey/GIFL/OpenSubtitles.bmp http://dl.dropbox.co...TVSubtitles.bmp http://dl.dropbox.co...IFL/TheTVDb.bmp http://dl.dropbox.com/u/6428211/AutoHotkey/GIFL/UrbanDict.bmp http://dl.dropbox.com/u/6428211/AutoHotkey/GIFL/Wikipedia.bmp
Note: The accelerator keys will still work!
You may use this <snippet> to download the 10 bitmaps







