Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
From VFP to HTML
Message
 
To
15/04/2019 10:20:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01668080
Message ID:
01668298
Views:
136
Why not use the ShellAPI to do this? You can then use a button and skip the Web page. The behavior will be same as you're working with a registered Windows moniker (the `tel:` prefix).

You can send a `tel:14031233311` to the shell API and it'll do the same thing as what the browser does.
DO wwutils
GoUrl("tel:14031233311")
where GoUrl is:
****************************************************
FUNCTION GoUrl
******************
***    Author: Rick Strahl
***            (c) West Wind Technologies, 1996
***   Contact: rstrahl@west-wind.com
***  Modified: 03/14/96
***  Function: Starts associated Web Browser
***            and goes to the specified URL.
***            If Browser is already open it
***            reloads the page.
***    Assume: Works only on Win95 and NT 4.0
***      Pass: tcUrl  - The URL of the site or
***                     HTML page to bring up
***                     in the Browser
***    Return: 2  - Bad Association (invalid URL)
***            31 - No application association
***            29 - Failure to load application
***            30 - Application is busy 
***
***            Values over 32 indicate success
***            and return an instance handle for
***            the application started (the browser) 
****************************************************
LPARAMETERS tcUrl, tcAction, tcDirectory, tcParms

IF EMPTY(tcUrl)
   RETURN -1
ENDIF
IF EMPTY(tcAction)
   tcAction = "OPEN"
ENDIF
IF EMPTY(tcDirectory)
   tcDirectory = SYS(2023) 
ENDIF

DECLARE INTEGER ShellExecute  ;
    IN SHELL32.dll as ShellExec_1;
    INTEGER nWinHandle,;
    STRING cOperation,;
    STRING cFileName,;
    STRING cParameters,;
    STRING cDirectory,;
    INTEGER nShowWindow
    
IF EMPTY(tcParms)
   tcParms = ""
ENDIF

RETURN ShellExec_1( _Screen.HWnd,;
                    tcAction,tcUrl,;
                    tcParms,tcDirectory,1)
Now on my machine I don't have phone apps configured so it prompts with the `Open With` dialog and I don't see a phone app there. I can select Skype from disk though and the choose that as my main choice and it'll work from then on forward. Not exactly smooth unless you're dealing with sophisticated users or you know they have Skype (or whatever else) set up as their default dialer.

+++ Rick ---

>Even with some sample code that I received I can't figure out how to do what should be something easy to do... for someone who knows how to do it ;-)
>
>I want to create HTML code that will be executed from VFP. Sorry for the following but I couldn't figure out how to post full html code here without it being executed. I just hope that you will understand what I need.
>
>a href="tel:5551234567">Call (555)123-4567
>
>That phone number is phony.
>
>So depending on the phone number selected by a user in my app I want to create an HTML page that contains a button with the selected phone number on it. Then the user will be able to call that phone numner by clicking on it.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform