GoogleBar: Schnelle Suche

  • Hier ein kurzes Script was dabei helfen soll, schnell mal was zu googlen: GoogleBar. Ich denke das ist ausbaufähig, aber seinen Zweck erfüllt es allemal jetzt schon!
    :)

    [autoit]


    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <File.au3>
    #include <Misc.au3>
    #include <IE.au3>

    [/autoit][autoit][/autoit][autoit]

    Opt("TrayMenuMode", 1)
    Local $exit = TrayCreateItem("Beenden")
    TraySetState()

    [/autoit][autoit][/autoit][autoit]

    GoogleBar()
    Func GoogleBar()
    GUICreate("GoogleBar", 300, 50, @DesktopWidth/2 - 150, -50, $WS_POPUP, $WS_EX_TOOLWINDOW)
    GUISetBkColor(0x357df3)
    $input = GUICtrlCreateInput("", 10, 10, 280, 28)
    GUICtrlSetFont(-1, 13, 400, 0, "Century Gothic")
    GUICtrlSetBkColor(-1, 0x357df3)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUISetState()

    While 1
    $msg = GUIGetMsg()
    $pos = MouseGetPos()
    $winpos = WinGetPos("GoogleBar")
    If $msg = $GUI_EVENT_CLOSE Then
    For $i = 0 To -50 Step -1
    WinMove("GoogleBar", "", @DesktopWidth/2 - 150, $i)
    Sleep((50 + $i)/5)
    Next
    BackWait()
    ElseIf TrayGetMsg() = $exit Then
    Exit
    ElseIf $pos[0] > @DesktopWidth/4 And $pos[1] < 100 And $pos[0] < @DesktopWidth/4*3 And $winpos[1] < 0 Then
    WinSetOnTop("GoogleBar", "", 1)
    For $i = -50 To 0
    WinMove("GoogleBar", "", @DesktopWidth/2 - 150, $i)
    Sleep(-$i/5)
    Next
    ElseIf $pos[0] < @DesktopWidth/4 Or $pos[0] > @DesktopWidth/4*3 Or $pos[1] > 180 And $winpos[1] = 0 Then
    For $i = 0 To -50 Step -1
    WinMove("GoogleBar", "", @DesktopWidth/2 - 150, $i)
    Sleep((50 + $i)/5)
    Next
    ElseIf _IsPressed("0D") And WinGetTitle("") = "GoogleBar" And $winpos[1] = 0 Then
    For $i = 0 To -50 Step -1
    WinMove("GoogleBar", "", @DesktopWidth/2 - 150, $i)
    Sleep((50 + $i)/5)
    Next
    WebSearch(GUICtrlRead($input))
    EndIf
    WEnd
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func WebSearch($search)
    GUIDelete()
    GUICreate("GoogleBar", @DesktopWidth*4/5, @DesktopHeight*4/5, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW)
    GUISetBkColor(0x357df3)
    $ie = _IECreateEmbedded()
    $browser = GUICtrlCreateObj($ie, 10, 10, @DesktopWidth*4/5 - 20, @DesktopHeight*4/5 - 20)
    _IENavigate($ie, "http://www.google.de/#q=" & $search)
    GUISetState()

    While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Or _IsPressed("1B") Then
    While _IsPressed("1B")
    Sleep(10)
    WEnd
    GUIDelete()
    GoogleBar()
    ElseIf TrayGetMsg() = $exit Then
    Exit
    EndIf
    WEnd
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func BackWait()
    TrayTip("GoogleBar", "Die GoogleBar ist immernoch geöffnet, befindet sich jedoch im Standby. Sie können sie jederzeit mit F9 starten und mit F10 beenden!", 5)
    While 1
    HotKeySet("{F9}", "main")
    HotKeySet("{F10}", "close")
    If TrayGetMsg() = $exit Then Exit
    WEnd
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func Close()
    Exit
    EndFunc

    [/autoit]