Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOw to return winodow directory from VFP? 1

Status
Not open for further replies.

FranklinYeung

Programmer
Apr 20, 2001
31
HK
Hi,

How can I get the window directory from VFP6? andy function to do this?


Many Thx.

Franklin
 
Chris,
SYS(2003) will return the Current Directory not the Windows directory our friend Franklin was asking for!!

Franklin,

Use this code to return the windows directory..
Code:
DECL INTEGER GetWindowsDirectory IN KERNEL32 AS GetWinDir STRING @lcBuffer, Long lnSize
lcBuffer= SPACE(260)
lnSize  = 260
=GetWinDir(@lcBuffer,lnSize)
*// Now you have the windows directory in the string 
*// variable lcBuffer, You can test this by ...
? lcBuffer
*// Don't forget to free your memory
CLEAR DLLS
Hope this will help Walid Magd
Engwam@Hotmail.com
 
Walid

I read Franklin's question to be "Where am I now in Windows?", hence the response.

Chris :)
 
Hi Franklin,
The easiest way to return Eindows directory is to issue the command
MyWinDir = GETENV("windir")
? MyWinDir
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Ramani,
Calling a native function is for sure more easy than using APIs, but GETENV() is not well documented in the help.
If you please can share your experience with us, basically what are the deferent parameters we can use with this function and where can we find documentation for that?
Thanks
Walid Magd
Engwam@Hotmail.com
 
Hi Walid,
When a person of your calibre is asking me to share the experience, I felt I should post it as a FAQ/Tips.
thread184-87044 is the result... I feel honoured..thanks.. ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Hi,

According to the VS Help, Is getenv will only return the dos environment parameter (path = ...) that specified in the autoexec.bat?

What if nothing in the autoexec.bat?


I am wondering about this.


Franklin
:)
 
Thnaks Ramani
It is my pleasure to mark this thread as helpful one. It was helpful for me getting red of API call in my code.
Thanks Walid Magd
Engwam@Hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top