Browser ocx on a progress screen

Posted by lucooms on 06-Mar-2015 08:58

Hello

 

I have put a webbrowser ocx on a progress screen .

Some of the webpages  do a POST to get new data to show in a webpage.

Is there a easy way to capture the POST message  in Progress ?  ( The form that is send to the server )

Is there a way to read the document in the webbrowser ?

 

Luc

Posted by lucooms on 10-Mar-2015 07:58

This seems to work

I have added a persistend procedure to the Control frame

 wlogical = CtrlFrame:ADD-EVENTS-PROCEDURE( whproc ) .

This presistent procedure is running

PROCEDURE FrmWebBrowse.WebBrowser.BeforeNavigate2 :

 DEFINE INPUT PARAMETER pDisp AS COM-HANDLE.

 DEFINE INPUT PARAMETER URL AS CHARACTER.

 DEFINE INPUT PARAMETER Flags AS INTEGER.

 DEFINE INPUT PARAMETER TargetFrameName AS CHARACTER.

 DEFINE INPUT PARAMETER PostData AS MEMPTR.

 DEFINE INPUT PARAMETER Headers AS LONGCHAR.

 DEFINE INPUT-OUTPUT PARAMETER Cancel AS LOGICAL.

 DEFINE VARIABLE wicounter AS INTEGER    NO-UNDO.

 DEFINE VARIABLE lTEXT AS LONGCHAR     NO-UNDO.

 wicounter = GET-SIZE(PostData) NO-ERROR.

 IF ERROR-STATUS:ERROR

 THEN  MESSAGE  " IN navigate 2 "  VIEW-AS ALERT-BOX.

 ELSE DO :

   MESSAGE  " IN navigate 2 " wicounter GET-STRING(PostData,1) VIEW-AS ALERT-BOX.

 END.

END PROCEDURE.

Posted by Matt Baker on 06-Mar-2015 09:34

 
Which OCX are you using?  Many of them have event handlers to trap clicks and network operations.
 
The documentation for the Internet Explorer OCX  is here.
https://msdn.microsoft.com/en-us/library/aa768400(v=vs.85).aspx
 
You probably want BeforeNavigate or BeforeNavigate2 event.  Both have contents of POST data and URl accessible to the parameters.
 
 
mattB

All Replies

Posted by Matt Baker on 06-Mar-2015 09:34

 
Which OCX are you using?  Many of them have event handlers to trap clicks and network operations.
 
The documentation for the Internet Explorer OCX  is here.
 
You probably want BeforeNavigate or BeforeNavigate2 event.  Both have contents of POST data and URl accessible to the parameters.
 
 
mattB

Posted by lucooms on 10-Mar-2015 07:58

This seems to work

I have added a persistend procedure to the Control frame

 wlogical = CtrlFrame:ADD-EVENTS-PROCEDURE( whproc ) .

This presistent procedure is running

PROCEDURE FrmWebBrowse.WebBrowser.BeforeNavigate2 :

 DEFINE INPUT PARAMETER pDisp AS COM-HANDLE.

 DEFINE INPUT PARAMETER URL AS CHARACTER.

 DEFINE INPUT PARAMETER Flags AS INTEGER.

 DEFINE INPUT PARAMETER TargetFrameName AS CHARACTER.

 DEFINE INPUT PARAMETER PostData AS MEMPTR.

 DEFINE INPUT PARAMETER Headers AS LONGCHAR.

 DEFINE INPUT-OUTPUT PARAMETER Cancel AS LOGICAL.

 DEFINE VARIABLE wicounter AS INTEGER    NO-UNDO.

 DEFINE VARIABLE lTEXT AS LONGCHAR     NO-UNDO.

 wicounter = GET-SIZE(PostData) NO-ERROR.

 IF ERROR-STATUS:ERROR

 THEN  MESSAGE  " IN navigate 2 "  VIEW-AS ALERT-BOX.

 ELSE DO :

   MESSAGE  " IN navigate 2 " wicounter GET-STRING(PostData,1) VIEW-AS ALERT-BOX.

 END.

END PROCEDURE.

This thread is closed