Code Sample to Find Application Path Using File Extension (121441)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft FoxPro for Windows 2.6
- Microsoft FoxPro for Windows 2.6a
This article was previously published under Q121441 SUMMARY
If you know the file extension of a file type that an application uses, you
can quickly determine the full path of that application by reading the
[EXTENSIONS] section of the WIN.INI file (the Windows 3.x initialization
file). To do this programmatically from FoxPro, you can use the
FOXTOOLS.FLL library to make a call to the Windows API
GetPrivateProfileString() function, as the code example below demonstrates.
NOTE: For backward compatibility, Visual FoxPro still supports FOXTOOLS.FLL
(included in earlier FoxPro versions), the Visual FoxPro API library that
allows calls to 16-bit .DLL functions. However, in Visual FoxPro, the
DECLARE command is the preferred method for calling .DLL functions.
Modification Type: | Major | Last Reviewed: | 11/17/2003 |
---|
Keywords: | kbcode KB121441 |
---|
|