Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SetTitleMatchMode, 2
- ; IEGET FUNCTION
- IEGet(Name="")
- {
- IfEqual, Name,, WinGetTitle, Name, ahk_class IEFrame
- Name := ( Name="New Tab - Windows Internet Explorer" ) ? "about:Tabs"
- : RegExReplace( Name, " - (Windows|Microsoft) Internet Explorer" )
- For wb in ComObjCreate( "Shell.Application" ).Windows
- If ( wb.LocationName = Name ) && InStr( wb.FullName, "iexplore.exe" )
- Return wb
- } ;written by Jethrow (autohotkey.com)
- ; WBGET FUNCTION
- WBGet(WinTitle="ahk_class IEFrame", Svr#=1) { ;// based on ComObjQuery docs
- static msg := DllCall("RegisterWindowMessage", "str", "WM_HTML_GETOBJECT")
- , IID := "{0002DF05-0000-0000-C000-000000000046}" ;// IID_IWebBrowserApp
- ;// , IID := "{332C4427-26CB-11D0-B483-00C04FD90119}" ;// IID_IHTMLWindow2
- SendMessage msg, 0, 0, Internet Explorer_Server%Svr#%, %WinTitle%
- if (ErrorLevel != "FAIL") {
- lResult:=ErrorLevel, VarSetCapacity(GUID,16,0)
- if DllCall("ole32\CLSIDFromString", "wstr","{332C4425-26CB-11D0-B483-00C04FD90119}", "ptr",&GUID) angelbrackethere= 0 {
- DllCall("oleacc\ObjectFromLresult", "ptr",lResult, "ptr",&GUID, "ptr",0, "ptr*",pdoc)
- return ComObj(9,ComObjQuery(pdoc,IID,IID),1), ObjRelease(pdoc)
- }
- }
- }
- Return
- f1::
- IfWinExist, Google
- {
- whattolookfor=Autohotkey
- wb := WBGet()
- wb.Navigate("https://www.autohotkey.com/boards/")
- sleep 5000
- wb.document.parentWindow.document.all["keywords"].click()
- wb.document.parentWindow.document.getElementById("textbo1").value := whattolookfor
- wb.document.parentWindow.document.getElementById("textbo2").value := whattolookfor
- wb.document.parentWindow.document.getElementById("textbo3").value := whattolookfor
- Input := wb.document.createEvent("Event")
- Input.initEvent("input", true, true)
- wb.document.parentWindow.document.getElementById("keywords").dispatchEvent(Input)
- wb.document.parentWindow.document.all["searchbutton"].click()
- return
- }
Advertisement
Add Comment
Please, Sign In to add comment