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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Systems Directory

API Functions

Get Systems Directory

by  jimoo  Posted    (Edited  )
* used to determine where to copy DLL's, location of the win.ini file, or other system resources.

? GetSystemDir()


************************************************************
* Windows API Call to determine the users system directroy
Function GetSystemDir
Local lcWinSysDir, lcWinDir, lnRetLen

* following dll gets our windows directory.
* declare Window API function for window system dir.
DECLARE LONG GetSystemDirectory IN win32api STRING lpBuffer, LONG nSize

* declare Window API function for windows dir.
DECLARE LONG GetWindowsDirectory IN win32api STRING lpBuffer, LONG nSize

lcWinSysDir = space(255)
lcWinDir = space(255)

* get the windows system directory
lnRetLen = GetSystemDirectory(@lcWinSysDir,LEN(lcWinSysDir))
lcWinSysDir = LEFT(lcWinSysDir,m.lnRetLen)

Return lcWinSysDir
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top