1

Тема: AHK: ie com, block exit tabs

Добрый день! Подскажите пож-та, возможно ли, поставить запрет на закрытие вкладок в ie? Заранее спасибо!


ie := ComObjCreate("InternetExplorer.Application")
ie.Visible := true

while ie.readystate <> 4
	continue

ie.Navigate("https://www.yandex.ru/")
ie.Navigate("https://www.mail.ru/",2048)
ie.Navigate("https://www.rambler.ru/",2048)

WinSet, Style, -0x80000, ahk_class IEFrame ; блокирует закрытие IE



2

Re: AHK: ie com, block exit tabs

Изучайте:
http://forum.script-coding.com/viewtopic.php?id=9480

3 (изменено: inseption86, 2018-11-03 18:58:03)

Re: AHK: ie com, block exit tabs

MalcevСпасибо! Но что то не получается, на примере  - кнопка "создать вкладку"


#If IsHomeKey()
LButton:: ToolTip 
#If

IsHomeKey() { 
    MouseGetPos, , , WinId, ControlNN 
    if !InStr( ControlNN, "DirectUIHWND")
        return 0
    WinGet, Process, ProcessName, ahk_id %WinId%
    if Process != iexplore.exe 
        return 0
    return GetTextUnderMouse() = "Создать вкладку (CTRL+T)" ? 1 : 0
} 

GetTextUnderMouse()  {
    Static h
    If !h
        h := DllCall("LoadLibrary","Str","oleacc","Ptr")
    If DllCall("oleacc\AccessibleObjectFromPoint"
                , "Int64", DllCall("GetCursorPos","Int64*",pt)+pt
                , "Ptr*", pacc, "Ptr", VarSetCapacity(varParent,8+2*A_PtrSize,0)*0+&varParent)=0
    Acc:=ComObjEnwrap(9,pacc,1), Parent:=NumGet(varParent,8,"UInt")
    try value := Acc.accValue(Parent)
    if value =
        try value := Acc.accName(Parent) 
    return value
}

4

Re: AHK: ie com, block exit tabs

http://forum.script-coding.com/viewtopi … 35#p125035