매크로

Tab입력시 다른 버튼이나 그런것들로 포커스가 이동이 되버리네요.


추가질문 붙여넣기도안되는데 어떤식으로하면 될까요?


  • profile
    예지력1 2015.10.16 02:28

    입력을 ActiveX 가 캐치하게 해야해요,

    웹검색용으로 제가 만들어쓰고있는 브라우저소스인데 OnMessage 부분이 질문에 대한 해답이에요

    참고해보시길!


    #NoEnv
    #NoTrayIcon
    #SingleInstance Off
    #KeyHistory 0
    ListLines Off
    SetBatchLines, -1
    new Browser()
    return

    class Browser
    {
     static URL := "https://duckduckgo.com/"
     
     __New()
     {
      global
      this.FBE(1)
      Gui, New, +Resize +hwndhMain
      this.hMain := hMain
      
      Gui, Add, ActiveX, x0 y0 w500 h500 hwndhEmbed vWB, Shell.Explorer
      this.hEmbed := hEmbed
      WB.silent := true, WB.Navigate(this.URL)
      
      this.Bound := []
      this.Bound.OnMessage := this.OnMessage.Bind(this)
      
      WinEvents.Register(this.hMain, this)
      for each, Msg in [0x0100]
       OnMessage(Msg, this.Bound.OnMessage)
      
      Gui,Show, % " w" A_ScreenWidth*0.3 " h" A_ScreenHeight*0.6 , 웹 브라우저
     }

     GuiSize()
     {
      DllCall("MoveWindow", "Ptr", this.hEmbed, "Int", 0, "Int", 0, "Int", A_GuiWidth, "Int", A_GuiHeight, "Int", 1)
     }
     
     GuiClose()
     {
      for each, Msg in [0x0100]
       OnMessage(Msg, this.Bound.OnMessage, 0)
      
      this.Delete("Bound")
      
      WinEvents.Unregister(this.hMain)
      Gui, Destroy
      this.FBE(0)
      ExitApp
     }
     
     OnMessage(wParam, lParam, Msg, hWnd)
     {
      global WB
      static fields := "hWnd,Msg,wParam,lParam,A_EventInfo,A_GuiX,A_GuiY"
      
      if (Msg == 0x100)
      {
       WinGetClass, Verify, ahk_id %hWnd%
       if (Verify = "Internet Explorer_Server")
       {
        pipa := ComObjQuery(WB.document, "{00000117-0000-0000-C000-000000000046}")
        VarSetCapacity(Msgs, 48)
        Loop Parse, fields, `,             ;`
        NumPut(%A_LoopField%, Msgs, (A_Index-1)*A_PtrSize)
        TranslateAccelerator := NumGet(NumGet(1*pipa)+5*A_PtrSize)
        Loop 2
         r := DllCall(TranslateAccelerator, "Ptr",pipa, "Ptr",&Msgs)
        until wParam != 9 || WB.document.activeElement != ""
        ObjRelease(pipa)
        if r = 0
         return 0  
       }
      }
     }
     
     FBE(Config)
     {
      static key := "Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", ieversion := ""
      
      if ieversion =
      {
       try {
        RegRead ver, HKLM, SOFTWARE\Microsoft\Internet Explorer, svcVersion
        ieversion :=  SubStr(ver, 1, InStr(ver, ".")-1)
       }
      }
      if Config = 1
       RegWrite, REG_DWORD, HKCU, %key%, % A_ScriptName, % ieversion * 1000
      else if Config = 0
       RegDelete HKCU, %key%, % A_ScriptName
     }
     
    }

    class WinEvents
    {
     static Table := {}
     
     Register(hWnd, Class, Prefix="Gui")
     {
      Gui, +LabelWinEvents.
      this.Table[hWnd] := {Class: Class, Prefix: Prefix}
     }
     
     Unregister(hWnd)
     {
      this.Table.Delete(hWnd)
     }
     
     Dispatch(hWnd, Type)
     {
      Info := this.Table[hWnd]
      
      return Info.Class[Info.Prefix . Type].Call(Info.Class)
     }
     
     Close()
     {
      return WinEvents.Dispatch(this, "Close")
     }
     
     Size()
     {
      return WinEvents.Dispatch(this, "Size")
     }
    }

  • _Crash 2015.10.16 13:18
    감사합니다 덕분에 완성했습니다!!
  • 제발등업좀2 2015.10.16 07:41
    쿨럭 어렵다.. ㄷㄷ 그래도 좋은자료가 될듯.. ㄱㅅ합니다.
  • profile
    외치기 2015.10.16 09:33

    오 이거 저도 궁금했던 부분인데 좋은질문이네요.

    예지력님에 답변도 엄청 유용하고요.

    굳!!!!

  • 아스키 2015.10.17 13:13

    64bit OS에서 32bit 프로그램을 실행하려면
        if A_Is64bitOS
        key := "Software\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION"


List of Articles
분류 제목 글쓴이 최근변경 추천
질문 이미지서치 픽셀서치를 여러개 할때 3 위험인물1 2015.10.11 0/0
질문 이에러좀 봐주세요 ... 9 제발등업좀2 2015.10.12 0/0
질문 오토핫키 여러사진 이미지 서치 질문 3 aces 2015.10.12 0/0
질문 루프중인 스레드 중지 4 엑시노트 2015.10.12 0/0
질문 님들 윈도우10에서 이미지서치나 픽셀서치 겟픽셀 어떤... 6 MC하얀늑대 2015.10.21 0/0
자유 GUI만들기 너무 귀찮네요. 15 외치기 2015.10.21 0/0
질문 gdip 이미지서치 질문입니다. 2 비빔면 2015.10.14 0/0
질문 이 오류좀 도와주세요..ㅠㅠ 2 횬히 2015.10.21 0/0
질문 Nox 비활성입력 해보신분? 2 _Crash 2015.10.15 0/0
질문 Gui ActiveX. 에서 Tab입력시 입력이들어가질않네요. ... 5 _Crash 2015.10.17 0/0
질문 비활성 붙여넣기 명령어 좀 알려주세요 ㅠㅠ 1 KAZUYA 2015.10.17 0/0
질문 Nox 에서 PostMessage 가 안되요. 4 마천루 2015.10.18 0/0
자유 오토핫키 질문좀 할ㄹ려고하는데 어디해야할지 몰라서 ... 수지가좋아 2015.10.17 0/0
질문 Gui ActiveX 에 Send,{Enter} 가 안들어가네요 ㅠㅠ. 3 _Crash 2015.10.20 0/0
질문 SciTE4AutoHotkey 질문드립니다. 2 doprop 2015.10.18 0/0
질문 document 엔터입력 1 _Crash 2016.04.16 0/0
자유 비활성 이미지서치 팁좀 주실 분 있나요... 4 sica 2016.01.22 0/0
질문 오토핫키 이미지 서치 질문하려구 합니다~ 2 서영욱 2015.10.22 0/0
질문 오토핫키 FTP 이용 다운로드 시 질문입니다. 5 2Yrs 2015.11.12 0/0
정보 팝업 알림, CleanNotify 3 예지력1 2015.11.11 4/0
Board Pagination Prev 1 ... 616263646566676869 ... 209 Next
/ 209

전체 최신 인기글

전체 주간 인기글