Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving Windows File Associations via VFP
Message
De
02/06/2003 10:31:17
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
02/06/2003 10:24:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00795191
Message ID:
00795196
Vues:
67
>How can I get the Windows (registry) File association via VFP or WinAPI. I am returning a file from GETFILE() call, and need to automatically load this file in Windows associated application synchronously (must terminate external application to return to VFP application for event capture).
>
>Fz - Boston MA

Async or Sync ? If async simply load the application with ShellExecute().
If sync and you want the executable check Solution.app.. Below is extracted from solution.app :
Function GetExecutable
LPARAMETERS tcExtension
LOCAL cExtn,cAppKey,cAppName,nErrNum,cNewKey 
LOCAL oReg,cVersion
cAppKey = ""
cAppName = ""

oReg = NewObject("FileReg",HOME()+"samples\classes\registry.prg")

* Get Application
IF( oReg.GetAppPath(m.tcExtension,@cAppKey,@cAppName) # 0 )
	RETURN ''
ENDIF

* Remove switches here (i.e., C:\EXCEL\EXCEL.EXE /e)
IF ATC(".EXE",m.cAppName) # 0
	m.cAppName= ALLTRIM(SUBSTR(m.cAppName,1,ATC(".EXE",m.cAppName)+3))
	IF ASC(LEFT(cAppName,1))=34	&&check for long file name in quotes
		m.cAppName = SUBSTR(m.cAppName,2)
	ENDIF
ENDIF
RETURN m.cAppName
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform