Heres a simple example to fit your needs. Do this in a test:-
DECLARE INTEGER GetWindowsDirectory IN Win32API; && Strict function name
STRING lcBuffer; && to store the directory name
INTEGER lnBufSize && to tell function max length
STORE SPACE(100) TO lcBuffer
GetWindowsDirectory(@lcBuffer,LEN(lcBuffer)
lcBuffer will then contain the windows directory (with null terminator) look for null within the string (LEFT(lcBuffer,AT(CHR(0),lcBuffer)) to get directory.
If you have either FoxPro 2.6 or VFP3 available, there is a WIN32API.HLP file contained - interesting reading. It is designed more for C programming so if you look at the type declarations, you will need to convert them (here I converted LPTSTR to STRING and UINT to INTEGER).
Have fun,
>Nigel, thanks for your prompt reply.
>Could you share with me how to go about using API? Thanks.
>
>>The simple way is to call RUN /N c:\windows\explorer.exe - you may consider using the API to get the windows directory first.