tabnation

ie coms 1

Feb 26th, 2021
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. SetTitleMatchMode, 2
  2. ; IEGET FUNCTION
  3. IEGet(Name="")
  4. {
  5. IfEqual, Name,, WinGetTitle, Name, ahk_class IEFrame
  6. Name := ( Name="New Tab - Windows Internet Explorer" ) ? "about:Tabs"
  7. : RegExReplace( Name, " - (Windows|Microsoft) Internet Explorer" )
  8. For wb in ComObjCreate( "Shell.Application" ).Windows
  9. If ( wb.LocationName = Name ) && InStr( wb.FullName, "iexplore.exe" )
  10. Return wb
  11. } ;written by Jethrow (autohotkey.com)
  12.  
  13. ; WBGET FUNCTION
  14. WBGet(WinTitle="ahk_class IEFrame", Svr#=1) { ;// based on ComObjQuery docs
  15. static msg := DllCall("RegisterWindowMessage", "str", "WM_HTML_GETOBJECT")
  16. , IID := "{0002DF05-0000-0000-C000-000000000046}" ;// IID_IWebBrowserApp
  17. ;// , IID := "{332C4427-26CB-11D0-B483-00C04FD90119}" ;// IID_IHTMLWindow2
  18. SendMessage msg, 0, 0, Internet Explorer_Server%Svr#%, %WinTitle%
  19. if (ErrorLevel != "FAIL") {
  20. lResult:=ErrorLevel, VarSetCapacity(GUID,16,0)
  21. if DllCall("ole32\CLSIDFromString", "wstr","{332C4425-26CB-11D0-B483-00C04FD90119}", "ptr",&GUID) angelbrackethere= 0 {
  22. DllCall("oleacc\ObjectFromLresult", "ptr",lResult, "ptr",&GUID, "ptr",0, "ptr*",pdoc)
  23. return ComObj(9,ComObjQuery(pdoc,IID,IID),1), ObjRelease(pdoc)
  24. }
  25. }
  26. }
  27. Return
  28.  
  29. f1::
  30. IfWinExist, Google
  31. {
  32. whattolookfor=Autohotkey
  33. wb := WBGet()
  34. wb.Navigate("https://www.autohotkey.com/boards/​")
  35. sleep 5000
  36. wb.document.parentWindow.document.all["keywords"].click()
  37. wb.document.parentWindow.document.getElementById("textbo1").value := whattolookfor
  38. wb.document.parentWindow.document.getElementById("textbo2").value := whattolookfor
  39. wb.document.parentWindow.document.getElementById("textbo3").value := whattolookfor
  40. Input := wb.document.createEvent("Event")
  41. Input.initEvent("input", true, true)
  42. wb.document.parentWindow.document.getElementById("keywords").dispatchEvent(Input)
  43. wb.document.parentWindow.document.all["searchbutton"].click()
  44. return
  45. }
Advertisement
Add Comment
Please, Sign In to add comment