Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Internet explorer contextuel menu
Message
De
02/05/2018 15:03:57
 
 
À
02/05/2018 14:39:13
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Divers
Thread ID:
01659647
Message ID:
01659694
Vues:
41
yes i used communly this trick all times to fake the IE navigation and use the beforeNavigate2 event to redirect to a vfp code.
in beforenavigate2 can use parameter Cancel=.t. execute a vfp code and return false.
see in my blog for ex: http://yousfi.over-blog.com/2015/02/a-css-web-menu-on-vfp-form.html

in vbscript (stopped by Microsoft but it works yet at this time):
this is the code called from the new menu item added to the registry as ie_menu0.html
note that works only when called from IE context menu with extended key vfp&menu as described above.
it create a vfp new window application , a form with edibox and the text selection made from IE is copied automatically in editbox.

< HTML>
< script language="VBScript">

Dim oVFP
Set oVFP = CreateObject("VisualFoxPro.Application")
Set parentwin = external.menuArguments
Set doc = parentwin.document
Set sel = doc.selection
Set rng = sel.createRange()
str = rng.text

oVFP.SetVar "cTextFromIE", str
oVFP.DoCmd "*? cTextFromIE"
oVFP.DoCmd "_cliptext=cTextFromIE"
oVFP.DoCmd "messagebox(cTextFromIE,0+32+4096,'',2000)"
oVFP.DoCmd "oform=newObject('form')"
oVFP.DoCmd "oform.caption='the text is selectionned, captured form IE11 and directed to vfp form editbox.' "
oVFP.DoCmd "oform.addobject('edit1','editbox')"
oVFP.DoCmd "oform.width=820"
oVFP.DoCmd "oform.height=620"
oVFP.DoCmd "oform.autocenter=.t."

oVFP.DoCmd "oform.edit1.left=5"
oVFP.DoCmd "oform.edit1.top=5"
oVFP.DoCmd "oform.edit1.width=800"
oVFP.DoCmd "oform.edit1.height=600"
oVFP.DoCmd "oform.edit1.forecolor=rgb(128,0,64)"
oVFP.DoCmd "oform.edit1.fontbold=.t."
oVFP.DoCmd "oform.edit1.fontname='courier new'"
oVFP.DoCmd "oform.edit1.fontsize=10"
oVFP.DoCmd "oform.edit1.value=cTextFromIE"
oVFP.DoCmd "oform.edit1.visible=.t."
oVFP.DoCmd "declare integer BringWindowToTop in user32 integer HWND"
oVFP.Docmd "bringwindowtotop(oform.hwnd)"
oVFP.DoCmd "oform.show(1)"
oVFP.Visible=True

< /script>
< /HTML>

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform