Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- One file follows -->
- <!-- Search.hta -->
- <!-- An Internet search utility -->
- <HTML>
- <HEAD><TITLE>Search</TITLE>
- <HTA:APPLICATION ID="oMyApp"
- APPLICATIONNAME="Search"
- BORDER="normal"
- BORDERSTYLE="sunken"
- CONTEXTMENU="yes"
- CAPTION="yes"
- ICON="C:\windows\system32\shell32,-5"
- SCROLL="no"
- SHOWINTASKBAR="yes"
- SINGLEINSTANCE="yes"
- SYSMENU="yes"
- WINDOWSTATE="normal"
- />
- <style>
- BODY {font-size :100%;font-family: Arial, Helvetica, sans-serif;color: black;
- background-color: ivory;
- margin-top:10pt; margin-left:20pt; margin-right:10pt ; text-align:Justify}
- P {margin-left:0pt;margin-right:0pt}
- </style>
- <SCRIPT LANGUAGE="VBScript">
- Dim Searchterm
- Sub Search
- ' On Error Resume Next
- Set WshShell = CreateObject("WScript.Shell")
- If tb2(6).Checked=True then WshShell.Run "https://www.google.com.au/search?q=site:stackoverflow.com+" & Replace(tb1.value, " ", "+")
- If tb2(5).Checked=True then WshShell.Run "https://www.google.com.au/maps/place/" & Replace(tb1.value, " ", "+")
- If tb2(4).Checked=True then WshShell.Run "https://www.google.com.au/search?q=" & Replace(tb1.value, " ", "+") & "&cr=countryAU"
- If tb2(3).Checked=True then WshShell.Run "https://www.google.com.au/search?q=site:msdn.microsoft.com+" & Replace(tb1.value, " ", "+")
- If tb2(2).Checked=True then WshShell.Run "https://www.google.com.au/search?q=nethack+" & Replace(tb1.value, " ", "+")
- If tb2(1).Checked=True then WshShell.Run "https://en.wikipedia.org/wiki/" & tb1.value
- If tb2(0).Checked=True then WshShell.Run "https://www.google.com.au/search?q=" & Replace(tb1.value, " ", "+")
- If tb4.checked=false then WshShell.RegWrite "HKCU\Software\StackOverflow\VBS\Searchterm", tb1.value & vbtab & WshShell.RegRead("HKCU\Software\StackOverflow\VBS\Searchterm")
- If tb3.checked=true then
- window.close
- Else
- document.parentwindow.refresh
- End If
- End Sub
- Sub Init
- Count = 0
- window.resizeTo 600, 375
- ' On Error Resume Next
- Set WshShell = CreateObject("WScript.Shell")
- HistoryArr = Split(WshShell.RegRead("HKCU\Software\StackOverflow\VBS\Searchterm"), Chr(9))
- If Not IsNull(HistoryArray) then tb1.value = HistoryArr(0)
- For each t in HistoryArr
- Count=Count + 1
- Set Hist = document.createElement("OPTION")
- Hist.Text=t
- Hist.Value=Count
- HistoryList.Add(Hist)
- Count=Count + 1
- If Count > 50 then exit For
- next
- tb1.select
- ' tb1.focus
- End Sub
- Sub Paste
- tb1.value=document.parentwindow.clipboardData.GetData("TEXT")
- tb1.select
- End Sub
- Sub LBTransfer
- x = CLng(HistoryList.Options.selectedindex)
- tb1.value = HistoryList.Options(x).text
- tb1.select
- End Sub
- Sub LBTransferK
- x = CLng(HistoryList.Options.selectedindex)
- tb1.value = HistoryList.Options(x).text
- HistoryList.focus
- End Sub
- </script>
- </head>
- <body Onload=Init>
- <p><b>Enter <u>s</u>earch term</b></p>
- <p><INPUT Name=tb1 TYPE=Text size=60 AccessKey=s> <INPUT NAME="Search" TYPE="SUBMIT" VALUE="Search" OnClick=Search></p>
- <p><INPUT Name=tb3 TYPE=CHECKBOX CHECKED AccessKey=c> <u>C</u>lose on search <INPUT Name=tb4 TYPE=CHECKBOX AccessKey=d> <u>D</u>on't save search term in history <a onclick=paste href=# AccessKey=p><u>P</u>aste clipboard</a></p>
- <p><b><u>H</u>istory</b></p>
- <p><SELECT NAME="HistoryList" SIZE="4" Onclick=LBTransfer OnKeyPress=LBTransferK AccessKey=h>
- </SELECT></p>
- <p><b>Search <u>w</u>here</b></p>
- <p><INPUT Name=tb2 TYPE=RADIO CHECKED AccessKey=w> Google <INPUT Name=tb2 TYPE=RADIO> Wikipedia <INPUT Name=tb2 TYPE=RADIO> Nethack <INPUT Name=tb2 TYPE=RADIO> MSDN <INPUT Name=tb2 TYPE=RADIO> Australia <INPUT Name=tb2 TYPE=RADIO> Maps <INPUT Name=tb2 TYPE=RADIO> Stack Overflow</p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment