Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Data to and from an open Browser Window

Status
Not open for further replies.

andy0923

Programmer
Jul 26, 2002
65
US
I have a table of data (lets say user id's, passwords, addresses, etc). I would like to be able to grab the data from the foxpro data and have it placed in the text fields of the browser (Internet Explorer Window).

Conceptually, I was thinking that a Foxpro program would be able to read either the caption or the window number of the IE window (which would previously be related in the table), match the data and then fill in the text field. At its simplest level, using only one field, I guess _cliptext could be used, but i was hoping for a more robust solution. Would anyone have any ideas on (1) reading the IE window caption and (2) filling in the text fields in the IE window with data from the Foxpro table? Thank you in advance.
 
It depends. I don't see anywhere in you message that this is an actual website, where the website accepts POST commands.
I guess if you were using automation, you could use the location property to find the caption
Code:
o = CREATEOBJECT("internetexplorer.application")
o.Navigate2("[URL unfurl="true"]www.microsoft.com")[/URL]
?o.LocationName

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
For example, in the window in which I am writing this, the window caption is "Microsoft:VFP - Web Related Issues - Sending Data to and from an open Browser Window - Microsoft In..."

Assuming I were running a foxpro program (either prg or exe) and an IE explorer browser window, how do I capture that window caption.

I am rather new to integrating Foxpro with websites.

Again thank you for your help
 

You mean that Internet Explorer was started outside of Foxpro? I don't think you can do that, you would need a handle of somekind.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Yes precisely - it was started outside of Foxpro
 
As mentionned, you cannot do that. Foxpro is unaware of the existence of Internet Explorer. Although I believe that there Temporary Internet files created, but that would be tricky to pick up current location from that.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Thank you Mike. I know there are programs that do do that. For example, a program like "Macro Express" will bring a window to the front based upon its caption. I thought there might be a way of Foxpro doing that as well.

You did provide thought going through the back door by calling every thing through Foxpro but that might be more trouble than its worth.
 
Using API calls you can find most windows and processes and take a hold of them, see the VFP General Faq section ( With Processes it's not so straight forward to link the proc ID to a Window Id but it can be done. I have no idea if you can 'drive' the taken window/proc after you've taken hold of it though. Mike would know better than I and perhaps that's why he's stating it can't be done even though you can take 'control' of the IE window.

Ralph Kolva
 
The thing is, even though you grab a handle to the existing browser/window, you still would need a way to reference all the inputs on the page. Those may be a somewhat or even totally local to the browser session.
You may be better off grabbing those values from the table using the browser, but pushing them to the browser may be a bit of a challenge.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top