English
Source / code snippets

Control Hook Html mouse rights Lock - 2

 
mouse Hook rights mouse HTML Control Lock
without Hook:
Andreas Miethe

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
 
01/26/06  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.294 Views

Untitledvor 0 min.
AndreasS11/27/18
Andreas Koch11/07/16
Ernst04/14/16
Tommy01/30/14
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie