| mouse Hook rights mouse HTML Control Lock
{$cleq}
{$compiler x11rc8}
{$runtime x11rc8}
windowStyle 512 | 8
cls
userMessages wm_eraseBkGnd,wm_close
long hMyMHook=setWindowsHookExA(7,procAddr(hpMyMH,3),hInstance,getWindowThreadProcessId(Hwnd,)),
hMyHTMLBox=create(HTMLWin,hWnd,http://gamsav.XProfan.com/Gamsav,1,,,600,400)
do {
waitinput
select uMessage
caseof wm_close
break
endSelect
}
unhookWindowsHookEx(hMyMHook)
end
hpMyMH(long _msg,_wp,_lp){
select _wp
caseof wm_rButtonDown
return true
endSelect
return false
}
without Hook: Andreas Miethe
$H messages.ph
$H windows.ph
declare html&,subwin&
cls
html&=Create(HTMLWin,%hWnd,http://www.ampsoft.eu,1,0,0,600,400)
while HTMLWin(GetBusy,html&)
Wend
~EnumChildWindows(html&,ProcAddr(GetServerWindow,2),0)
SubClass subwin&,1
while 1
waitinput
endwhile
SubClassProc
If SubClassMessage(subwin&,~wm_contextmenu)
settext %hwnd,time$(0)+:+time$(1)
Set(WinProc,0)
endif
endproc
Proc GetServerWindow
parameters wnd&,lparam&
If ClassOf(wnd&) = Shell Embedding
~EnumChildWindows(wnd&,ProcAddr(GetServerWindow,2),0)
elseIf ClassOf(wnd&) = Shell DocObject View
~EnumChildWindows(wnd&,ProcAddr(GetServerWindow,2),0)
elseIf Classof(wnd&) = internet Explorer_Server
Subwin& = wnd&
Windowtitle server found
Endif
Return 1
ENDPROC
by OCX Uwe Pascal Niemeier
Hello people! The Vollständigkeit halber, even if it whom most well To tricky is ... an Possibility, the Context menu one WebBrowser-Controls To Change is the Creation one own IDocHostUIHandler-Interfaces, the in lieu of the Originals inserted becomes. this interface contains u.A. The method ShowContextMenu, for a Profan-Proc uses go can: (prerequisite: OCX-Package 2 + XProfan 10)window 10,10-500,400
usermessages 16
$H Messages.ph
$H windows.ph
$H ocx2.ph
$I ocx2.inc
ocxInit()
declare VTable#
dim VTable#,76
proc CreateIMD---------------------------CreateInterfaceMethodDummy
var a&=~GlobalAlloc(0,16)
long a&,0=-1192457387,&(2),-1034033781,&(1)*4+4
return a&
endproc-------------------------------------------------------------
proc ShowContextMenu--------------------------------ShowContextMenu
parameters This&,ID&,Point&,IUnknown&,IDispatch&
~ScreenToClient(%hwnd,Point&)
createmenu
case ID&=0:appendmenu 101,Context menu leerer area
case ID&=1:appendmenu 102,Context menu Image
case ID&=4:appendmenu 103,Context menu markierter Text
case ID&=5:appendmenu 104,Context menu Link
trackmenu long(Point&,0),long(Point&,4)
~RedrawWindow(%hwnd,0,0,$485)
return 0
endproc-------------------------------------------------------------
proc InitICustomDoc----------------------IDocHostUIHandler-interface
parameters Object&
long VTable#,0= CreateIMD(2,1)QueryInterface
long VTable#,4= CreateIMD(0,0)AddRef
long VTable#,8= CreateIMD(0,0)Release
long VTable#,12=procaddr(ShowContextMenu,5)
long VTable#,16=CreateIMD(1,1)GetHostInfo
long VTable#,20=CreateIMD(5,1)ShowUI
long VTable#,24=CreateIMD(0,0)HideUI
long VTable#,28=CreateIMD(0,1)UpdateUI
long VTable#,32=CreateIMD(1,1)EnableModeless
long VTable#,36=CreateIMD(1,1)OnDocWindowActivate
long VTable#,40=CreateIMD(1,1)OnFrameWindowActivate
long VTable#,44=CreateIMD(3,1)ResizeBorder
long VTable#,48=CreateIMD(3,1)TranslateAccelerator
long VTable#,52=CreateIMD(2,1)GetOptionKeyPath
long VTable#,56=CreateIMD(2,1)GetDropTarget
long VTable#,60=CreateIMD(1,1)GetExternal
long VTable#,64=CreateIMD(3,1)TranslateUrl
long VTable#,68=CreateIMD(2,1)FilterDataObject
long VTable#,72=VTable#
var IFace&=VTable#+72
var Document&=ocxGet(Object&,Document)
var ICustomDoc&=QueryInterface(Document&,{3050f3f0-98b5-11cf-bb82-00aa00bdce0b})
CallMethod(ICustomDoc&,3,IFace&)--ICustomDoc::SetUIHandler
ocxRelease(ICustomDoc&,Document&)
endproc-------------------------------------------------------------
declare Control&
var URL$=C:Test.html---Irgendeine HTML(!)-File
var Object&=ocxCreate(Url$,%hwnd,10,10,400,300,$50b00000,addr(Control&))
InitICustomDoc(Object&)
while 1
waitinput
case %umessage=16:break
settext %hwnd,st$(%menuitem)
endwhile
ocxRelease(Object&)
destroywindow(Control&)
ocxDeInit()
PS: The Proc CreateIMD created by Embedded ASM a manner Dummy, lest for each method a Own Proc be installed must. Genauere Description and further Demos about Event-Handling (incident-Auswertung) go in the OCX-Package 3 include his, so it because ever ready and is under XProfan 11 run is SeeYou Pascal |
|