problem is
If I press {backspace} key on Tab1 (ImDB)
it performs Browser_Back for Tab2 (Rotten Tomatoes) and vice versa
same for 'Enter' .. it doesnt work
those keys worked when I have only 1 tab
Any solution? sorry for my bad English
Code: Select all
/*
__ __ __ __ __ __ __ _ __
/ /_ / /_/ /_____ _ / // /____ _/ /_ / /________________(_)___ / /_ ____ _______
/ __ \/ __/ __/ __ \(_) // // __ '/ __ \/ //_/ ___/ ___/ __/ / __ \/ __// __ \/ __/ _ \
/ / / / /_/ /_/ /_/ / / // // /_/ / / / / ,< (__ ) /__/ / / / /_/ / /__/ /_/ / / / // /
/_/ /_/\__/\__/ .___(_) // / \__,_/_/ /_/_/|_/____/\___/_/ /_/ .___/\__(_)____/_/ \__ /
/_/ /_//_/ /_/ (___/
Subject : [How To] Implement Tabstop for ActiveX > Shell.Explorer
Author : SKAN, for the technique described on topic.
Topic : http://ahkscript.org/boards/viewtopic.php?f=7&t=879
*/
#NoEnv
#SingleInstance Force
#Persistent
SetWorkingDir %A_ScriptDir%
Gui, +LastFound +Resize +OwnDialogs
Gui, Default
OnMessage(11, "DisableSetRedraw")
Gui Add, Edit, w930 -E0x200 vURL,
;Gui Add, Button, x+6 yp w44 Default, Go
Gui, Add, Tab2, x0 y30 Buttons vWhichTab, IMDB|Tomatatoes
Gui, Tab, 1
Gui Add, ActiveX, xm w900 h600 E0x10000 vWB hwndATLWinHWND, Shell.Explorer
WB.silent := true
ComObjConnect(WB, WB_events)
IOleInPlaceActiveObject_Interface := "{00000117-0000-0000-C000-000000000046}"
pipa := ComObjQuery( WB, IOleInPlaceActiveObject_Interface )
TranslateAccelerator := NumGet( NumGet( pipa+0 ) + 5*A_PtrSize )
OnMessage( 0x0100, "WM_KeyPress" ) ; WM_KEYDOWN
OnMessage( 0x0101, "WM_KeyPress" ) ; WM_KEYUP
Gui, Tab, 2
Gui Add, ActiveX, xm w900 h600 E0x10000 vWB2 hwndATLWinHWND2, Shell.Explorer
WB2.silent := true
ComObjConnect(WB2, WB_events)
IOleInPlaceActiveObject_Interface2 := "{00000117-0000-0000-C000-000000000046}"
pipa2 := ComObjQuery( WB2, IOleInPlaceActiveObject_Interface2 )
TranslateAccelerator2 := NumGet( NumGet( pipa2+0 ) + 5*A_PtrSize )
OnMessage( 0x0100, "WM_KeyPress2" ) ; WM_KEYDOWN
OnMessage( 0x0101, "WM_KeyPress2" ) ; WM_KEYUP
OnExit, GuiClose
Gui, Show,, Film Browser
URL1 := "http://www.imdb.com/movies-in-theaters/?ref_=nv_tp_inth_1"
URL2 := "http://www.rottentomatoes.com/mobile/"
WB.Navigate(URL1)
WB2.Navigate(URL2)
return
/*
ButtonGo:
Gui Submit, NoHide
if WhichTab = 왓챠
WB.Navigate(URL)
if WhichTab = 서치팡
WB2.Navigate(URL)
Return
*/
class WB_events
{
NavigateComplete2(wb, NewURL)
{
GuiControl,, URL, %NewURL% ; Update the URL edit control.
}
DocumentComplete( WB, NewURL )
{
; check all frames and elements for input focus
; WB.Document.Body.Focus()
}
}
GuiClose:
ObjRelease( pipa )
ObjRelease( pipa2 )
OnExit
ExitApp
Return
GuiSize:
{
;// if there is a resize event lets resize the browser
WinMove, % "ahk_id " . ATLWinHWND, , 0,60, A_GuiWidth, A_GuiHeight
WinMove, % "ahk_id " . ATLWinHWND2, , 0,60, A_GuiWidth, A_GuiHeight
return
}
WM_KeyPress( wParam, lParam, nMsg, hWnd ) {
Global WB, pipa, TranslateAccelerator
Static Vars := "hWnd | nMsg | wParam | lParam | A_EventInfo | A_GuiX | A_GuiY"
WinGetClass, ClassName, ahk_id %hWnd%
If ( ClassName = "Shell DocObject View" && wParam = 0x09 ) {
WinGet, hIES, ControlListHwnd, ahk_id %hWnd% ; Find child of 'Shell DocObject View'
ControlFocus,, ahk_id %hIES%
Return 0
}
If ( ClassName = "Internet Explorer_Server" ) {
VarSetCapacity( MSG, 48, 0 ) ; MSG STructure http://goo.gl/4bHD9Z
Loop, Parse, Vars, |, %A_Space%
NumPut( %A_LoopField%, MSG, ( A_Index-1 ) * A_PtrSize )
Loop 2 ; IOleInPlaceActiveObject::TranslateAccelerator method http://goo.gl/XkGZYt
r := DllCall( TranslateAccelerator, UInt,pipa, UInt,&MSG )
Until wParam != 9 || WB.document.activeElement != ""
IfEqual, R, 0, Return, 0 ; S_OK: the message was translated to an accelerator.
}
}
WM_KeyPress2( wParam, lParam, nMsg, hWnd ) {
Global WB2, pipa2, TranslateAccelerator2
Static Vars2 := "hWnd | nMsg | wParam | lParam | A_EventInfo | A_GuiX | A_GuiY"
WinGetClass, ClassName2, ahk_id %hWnd%
If ( ClassName2 = "Shell DocObject View" && wParam = 0x09 ) {
WinGet, hIES, ControlListHwnd, ahk_id %hWnd% ; Find child of 'Shell DocObject View'
ControlFocus,, ahk_id %hIES%
Return 0
}
If ( ClassName2 = "Internet Explorer_Server" ) {
VarSetCapacity( MSG, 48, 0 ) ; MSG STructure http://goo.gl/4bHD9Z
Loop, Parse, Vars2, |, %A_Space%
NumPut( %A_LoopField%, MSG, ( A_Index-1 ) * A_PtrSize )
Loop 2 ; IOleInPlaceActiveObject::TranslateAccelerator method http://goo.gl/XkGZYt
r := DllCall( TranslateAccelerator2, UInt,pipa2, UInt,&MSG )
Until wParam != 9 || WB2.document.activeElement != ""
IfEqual, R, 0, Return, 0 ; S_OK: the message was translated to an accelerator.
}
}
DisableSetRedraw() {
return 0
} :beer: