BitByteBit, A few lines to add to your code just before and within your While...WEnd loop: $dll = DllOpen("user32.dll") $Search_Handle = GUICtrlGetHandle($Search) While 1 $nMsg = GUIGetMsg() ;$Msg= GUIGetMsg ($GUI_EVENT_PRIMARYDOWN) Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Google Google() Case $GUI_EVENT_PRIMARYDOWN $aCurInfo = GUIGetCursorInfo() If $aCurInfo[4] = $Search Then Sleep(100) Send("{HOME}{SHIFTDOWN}{END}{SHIFTUP}") EndIf