Windows API Guide: GetFocus Function


Declare Function GetSystemDirectory Lib "kernel32.dll" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long

Platforms: Win 32s, Win 95/98, Win NT

GetSystemDirectory reads the path of Windows's System directory. This is where many important files for Windows are stored, including the API DLLs. Never assume this is "C:\Windows\System" because the Windows directory doesn't have to be called Windows. The path of the system directory is put into the string variable passed as lpBuffer. The function returns the length of the string returned if it is successful, or 0 if it failed.

lpBuffer
A string which receives the path of the system directory.
nSize
The length in characters of lpBuffer.

Example:

' Display the path of the system directory Dim sysdir As String  ' receives path of system directory Dim slength As Long  ' receives length of returned string sysdir = Space(255)  ' make room in the buffer to receive the string slength = GetSystemDirectory(sysdir, 255)  ' determine the system directory's path sysdir = Left(sysdir, slength)  ' extract the returned string from the buffer Debug.Print "System directory path: "; sysdir

See Also: GetWindowsDirectory
Category: System Information

Go back to the alphabetical Function listing.
Go back to the Reference section index.


This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/g/getsystemdirectory.html



Windows API Guide
Windows API Guide - Reference - Volume 1: Version 3.0 For the MS-DOS and PC-DOS Operating Systems
ISBN: B001V0KQIY
EAN: N/A
Year: 1998
Pages: 610

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net