******************************************************************************** * Copied (and adapted) from the UniversalThread (FAQ#7656, by Gérald Santerre) * According to the author, opens an HTML document or mail. * Actually helps to open *any* document with its default association. FUNCTION RunDoc(tlDocument) local lnResult DECLARE INTEGER ShellExecute ; IN SHELL32.dll ; INTEGER nWinHandle, ; STRING cOperation, ; STRING cFileName, ; STRING cParameters, ; STRING cDirectory, ; INTEGER nShowWindow **retreive the main VFP window handle (this handle is used by ShellExecute) DECLARE INTEGER FindWindow ; IN WIN32API ; STRING cNull, ; STRING cWinName lnResult=ShellExecute(FindWindow( 0, _SCREEN.caption), "Open", tlDocument, "", "c:\temp\", 1) **Error messages if the return value is < 32 IF lnResult < 32 DO CASE CASE lnResult=2 Wait wind "Asociación inválida, o URL inválido." CASE lnResult=31 Wait wind "Falta la asociación." CASE lnResult=29 Wait wind "No se puede iniciar la aplicación." CASE lnResult=30 Wait wind "La aplicación ya está abierta." ENDCASE ENDIF