I open HTML page
oActiveX:=TActiveX():New( oWnd, "Shell.Explorer" )
oWnd:oClient:=oActiveX
oActiveX:Do( "Navigate2", cMyURL )It is possible read/write controls of page (Gets, tables. Events press button/menu) from FWH
oActiveX:=TActiveX():New( oWnd, "Shell.Explorer" )
oWnd:oClient:=oActiveX
oActiveX:Do( "Navigate2", cMyURL )You can manage the events that you receive from the ActiveX.
Please review fwh\samples\WebExp.prg source code
Thank, Antonio !
But I not understand how I can read content of get field ?
You need to search in Google for properties and methods documentation for "Shell.Explorer" ActiveX
Once seen some of its properties, then its easier to search in Google ![]()
http://msdn.microsoft.com/en-us/library ... ument.aspx
http://msdn.microsoft.com/en-us/library ... ument.aspx
I guess "document" is the property that you need to manage
Natter,
Did you resolve how to pass a value to a GET field into a webpage?
Can you share your experience?
Regards,
George
DEFINE WINDOW oWndnet MDICHILD OF oWnd vscroll icon oico TITLE ".:: Internet ::. "+alltrim(cENDE)
DEFINE BUTTONBAR oBarnet size 34,34 3D OF oWndnet
DEFINE BUTTON OF oBarnet resource "B1" NOBORDER ACTION( oActiveX:Do( "GoBack" ) ) MESSAGE "Voltar" tooltip "Voltar"
DEFINE BUTTON OF oBarnet resource "B2" NOBORDER ACTION( oActiveX:Do( "GoForward" ) ) MESSAGE "Avançar" tooltip "Avançar"
DEFINE BUTTON OF oBarnet resource "STOP2" NOBORDER ACTION( oActiveX:Do( "ExecWB",23,1 ) ) MESSAGE "Parar" tooltip "Parar"
DEFINE BUTTON OF oBarnet resource "REFRESH" NOBORDER ACTION( oActiveX:Do( "ExecWB",22,1 ) ) MESSAGE "Atualizar" tooltip "Atualizar"
DEFINE BUTTON OF oBarnet resource "SAVE2" NOBORDER ACTION( oActiveX:Do( "ExecWB", 4,1 ) ) MESSAGE "Salvar como" tooltip "Salvar como"
DEFINE BUTTON OF oBarnet resource "PRINT10" NOBORDER ACTION( oActiveX:Do( "ExecWB", 7,1 ) ) MESSAGE "Imprimir" tooltip "Imprimir"
DEFINE BUTTON OF oBarnet resource "QUIT2" NOBORDER ACTION( oWndnet:End() ) MESSAGE "Fechar" tooltip "Fechar"
oBarnet:bRClicked := { || ( NIL ) }
@ 0.7,42.5 say "Endereço:" of oBarnet size 50,18 font oFontenet
@ 0.7,38.5 btnget ocamnet var cENDE of oBarnet size 300,19 font oFontenet valid (if(GetKeyState( VK_RETURN ),obotnet:setfocus(),),.t.)
@ 0.4,102 buttonbmp obotnet PROMPT SPACE(5)+"&Ir" of oBarnet bitmap "SETA" size 50,22 TEXTRIGHT font oFontenet action(grava_parametro('FWULTIMOEMAIL',alltrim(cEnde)),oWndnet:ctitle(".:: Internet ::. "+alltrim(cENDE)), oActiveX:Do( "Navigate", alltrim(cENDE) ),cPesq:=space(100),ocamne2:refresh())
@ 0.7,113 say "Pesquisa:" of oBarnet size 50,18 font oFontenet
@ 0.7,91 btnget ocamne2 var cPesq of oBarnet size 213,19 font oFontenet valid (if(GetKeyState( VK_RETURN ),obotpes:setfocus(),),.t.)
@ 0.4,157.6 buttonbmp obotpes PROMPT SPACE(5)+"&Ir" of oBarnet bitmap "GOOGLE" size 50,22 TEXTRIGHT font oFontenet action(oWndnet:ctitle(".:: Internet - Pesquisa ::. "+alltrim(cPesq)),if(empty(cPesq),msg("Nenhuma palavra foi digitada!"),GoogleSearch(AllTrim(STRTRAN(cPesq," ","+")),@cENDE,ocamnet)))
oActiveX := TActiveX():New( oWndnet, "Shell.Explorer" )
oActiveX:SetProp( "StatusBar", .t. )
oWndnet:oClient := oActiveX
ACTIVATE WINDOW oWndnet MAXIMIZED on init(ocamnet:setfocus(),oActiveX:Do( "Navigate", alltrim(cSite) ));
valid(oActiveX:end(),.t.)
return(.t.)
Function GoogleSearch(cAlgo,cENDE,ocamnet)
local hE, cVar1, cVar3,cLink
cVar1 := "http://www.google.com/search?q="
cVar3 := "&ie=UTF-8&oe=UTF-8&hl=pt&btnG=B%C3%BAsqueda+en+Google&lr="
cLink := cVar1+cAlgo+cVar3
oActiveX:Do( "Navigate", cLink)
cEnde := space(100)
ocamnet:refresh()
SysRefresh()
return nil
![]()
SGS
Thanks for sharing with us your code.
May you indicate the variables that are using your code?
Regards,
George
George,
Do you mean to fill a GET or to supply a value as a parameter ?
FUNCTION SearchNameByPhone(cPhone)
local oWnd, oActiveX, cMyUrl
cMyUrl := "www.whitepages.com/search/ReversePhone?full_phone="
cMyUrl := cMyUrl + alltrim(cPhone)
DEFINE WINDOW oWnd TITLE "Verifying Customer's Phone Number" ;
FROM 5, 220 TO 725, 900 pixel
oActiveX = TActiveX():New( oWnd, "Shell.Explorer.2" )
oWnd:oClient = oActiveX
oActiveX:Do( "Navigate", cMyURL )
sysrefresh()
ACTIVATE WINDOW oWnd
sysrefresh()
RETURN (.T.)George,
good solution! ![]()