Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Link to Website
Message
 
À
07/09/2003 10:41:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00826860
Message ID:
00828699
Vues:
14
There used to be some issue about starting the default browser, whether it be Netscape or whatever. The following will use shelexecute to launch the default web browser whatever it may be (from ActiveVFP PostSetup and WebAppBuilder):
* Launch default browser
* First, create a known, temporary HTML file
BrowserExec = SPACE(255)
FileName = "C:\temphtm.HTM"
FileDir = ""
STRTOFILE("<HTML> <\HTML>",FileName)

* Then find the application associated with it
RetVal = FindExecutable(@FileName, @FileDir, @BrowserExec)
BrowserExec = TRIM(BrowserExec)
* If an application is found, launch it!
IF RetVal <= 32 OR EMPTY(BrowserExec)
	THIS.cError="Could not find associated Browser: " + GetLastError()
	RETURN THIS.cError
ELSE
	RetVal = ShellExecute(0,"open",BrowserExec,"http://localhost/"+cProd+"/"+"default.asp","",SW_SHOW)
	IF RetVal <= 32
		THIS.cError="URL Failed: " + GetLastError()
		RETURN THIS.cError
	ENDIF
ENDIF

DELETE FILE (FileName)
>I know there is a simple API call to pull up the browser and a web site link. I had the code printed out and can not find it now. Can someone send me the API call to do this again.
>
>Thanks
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform