Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Button to open browser
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Vista
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01282770
Message ID:
01282781
Views:
9
>hi all,
>I have a customer who wants to know if it is possible to have a button on a form that when clicked opens a browser and goes straight into google maps searching for an entry in a field. What is happening is that they always enter the town name in address field3 and they need to look some of them up on google maps, the button would facilitate this on one step
>~M

We do something similar with MapQuest - Here's what's in the click event of our button:

** Displays a map of this location using the mapquest website

GoURL("http://www.mapquest.com/maps/map.adp?country=US&addtohistory=&address=" + ;
urlEncode(ALLTRIM(this.parent.txtAddress.value)) + ;
"&city=" + urlEncode(ALLTRIM(this.parent.txtCity.value)) + ;
"&state=" + urlEncode(ALLTRIM(this.parent.txtState.value)) + ;
"&zip=" + urlEncode(ALLTRIM(this.parent.txtZip.value)) + ;
"&homesubmit=Get+map&size=big")

Here's GoURL.prg


** From Rick Strahl's article in FoxPro Advisor - Sept 2003 - Page 21

LPARAMETERS lcUrl, lcAction, lcDirectory, lcParams

IF EMPTY(lcUrl)

RETURN

ENDIF

IF EMPTY(lcAction)

lcAction = "OPEN"

ENDIF

IF EMPTY(lcDirectory)

lcDirectory = SYS(2023)

ENDIF

IF EMPTY(lcParams)

lcParams = ""

ENDIF

DECLARE integer ShellExecute ;
IN Shell32.dll ;
integer nWinHandl, ;
string cOperation, ;
string cFileName, ;
string cParameters, ;
string cDirectory, ;
integer nShowWindow

DECLARE integer FindWindow ;
IN WIN32API String cNull, String cWinName

RETURN ShellExecute(FindWindow(0, _SCREEN.Caption), ;
lcAction, lcUrl, ;
lcParams, lcDirectory, 1)
Previous
Reply
Map
View

Click here to load this message in the networking platform