Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using browser control in desktop application
Message
De
05/03/2002 01:19:30
 
 
À
07/02/2002 08:51:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00615869
Message ID:
00628233
Vues:
26
Robert,

I used your approach quite successfully for launching other form with pdf viewer ( Activex included with Acrobat Reader ) via hyperlink , but can't figure out how to bring focus to this form.

pdfformref.show() doesn't bring the focus being launched from BeforeNavigate2 event.




>>Could you anyone advise whether there is a sensible approach at all to let VFP container know that something was selected on rendered HTML page. Visually I'd like to render HTML page with some checkboxes and recognize check box checking/unchecking.
>
>Hi Michael,
>
>in the HTML source you could add an onClick event to your checkboxes which tries to change the URL of the browser window:
onClick="location.href='prg://test.prg with ['+this.name+']'"
In the BeforeNavigate2 event of your browser control you parse the URL for your self defined prg:// protocol, set the cancel property on true to avoid default behaviour of the event and call your programm to process the state of the checkbox. In my applications I am using the following code in the BeforeNavigate2 event of the browser control:
*** ActiveX-Steuerelementereignis ***
>LPARAMETERS pdisp, url, flags, targetframename, postdata, headers, cancel
>
>
>LOCAL lcCommand,lcURL,lnParamPos
>
>
>lcURL = LEFT(url,6)
>IF (lcURL = "scx://") OR (lcURL = "prg://")
>  cancel    = .T.
>  lcCommand = SUBSTR(url,7)
>  IF RIGHT(lcCommand,1) = "/"
>    lcCommand = LEFT(lcCommand,LEN(lcCommand)-1)
>  ENDIF
>ENDIF
>DO CASE
>  CASE lcURL = "prg://"
>    lcCommand = "DO " + STRTRAN(lcCommand,"%20"," ")  && aus der HTML-Seite kommen die Blanks als "%20"
>    &lcCommand
>    RETURN
>  CASE lcURL = "scx://"
>    DO FORM &lcCommand
>    RETURN
>ENDCASE
With this code and the onClick event from above a programm "test.prg" would be called with the checked property as parameter. Of course you could vary this example to your needs by transfering the controls name or whatever...
>
>HTH Robert
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform