Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using browser control in desktop application
Message
De
07/02/2002 08:51:19
 
 
À
05/02/2002 23:34:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00615869
Message ID:
00616555
Vues:
21
>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
I've acquired quite a taste for a well-made mistake... [Fiona Apple]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform