Skip to content

Files

Latest commit

 

History

History
59 lines (41 loc) · 1.47 KB

GetWindowsDirectory.md

File metadata and controls

59 lines (41 loc) · 1.47 KB

Home

Function name : GetWindowsDirectory

Group: System Information - Library: kernel32


The GetWindowsDirectory function retrieves the path of the Windows directory. The Windows directory contains such files as applications, initialization files, and help files.


Code examples:

Obtaining the System and Windows folder names
Reading data from INI files

Declaration:

UINT GetWindowsDirectory(
  LPTSTR lpBuffer,  // buffer for Windows directory
  UINT uSize        // size of directory buffer
);  

FoxPro declaration:

DECLARE INTEGER GetWindowsDirectory IN kernel32;
	STRING @ lpBuffer,;
	INTEGER  nSize  

Parameters:

lpBuffer [out] Pointer to the buffer to receive the null-terminated string containing the path

uSize [in] Specifies the maximum size of the buffer


Return value:

If the function succeeds, the return value specifies the number of characters written to the buffer, not including the terminating null character


Comments:

Alternatives to calling this API function:

? GETENV("windir")  
? GETENV("SystemRoot")

See also: GetSystemDirectory, SHGetFolderPath.