var Buffer: array[0..MAX_PATH - 1] of Char; size:cardinal; size:=sizeof(buffer); GetWindowsDirectory(buffer,size);
GetWindowsDirectory函数Unit Windows.PasSyntax GetWindowsDirectory( lpBuffer: PChar; {the buffer receiving Windows directory} uSize: UINT {the maximum size of the buffer} ): UINT; {returns the number of bytes written to the buffer}Description This function retrieves the path for the Windows directory. Typically, this is the directory where applications should store initialization files and help files.Parameters lpBuffer: A pointer to a null terminated string buffer receiving the Windows directory path. If this parameter is set to NIL, the function returns the required size of the buffer to hold the Windows directory path.uSize: Specifies the maximum size of the buffer pointed to by the lpBuffer parameter, and should indicate a minimum size of MAX_PATH characters.Return Value If the function succeeds, it returns the number of characters copied to the buffer pointed to by the lpBuffer parameter, not including the null terminator. If the function fails, it returns zero. To get extended error information, call the GetLastError function.The Tomes of Delphi 3: Win32 Core API Help File by Larry Diehl
Buffer: array[0..MAX_PATH - 1] of Char;
size:cardinal;
size:=sizeof(buffer);
GetWindowsDirectory(buffer,size);
Windows.PasSyntax
GetWindowsDirectory(
lpBuffer: PChar; {the buffer receiving Windows directory}
uSize: UINT {the maximum size of the buffer}
): UINT; {returns the number of bytes written to the buffer}Description
This function retrieves the path for the Windows directory. Typically, this is the directory where applications should store initialization files and help files.Parameters
lpBuffer: A pointer to a null terminated string buffer receiving the Windows directory path. If this parameter is set to NIL, the function returns the required size of the buffer to hold the Windows directory path.uSize: Specifies the maximum size of the buffer pointed to by the lpBuffer parameter, and should indicate a minimum size of MAX_PATH characters.Return Value
If the function succeeds, it returns the number of characters copied to the buffer pointed to by the lpBuffer parameter, not including the null terminator. If the function fails, it returns zero. To get extended error information, call the GetLastError function.The Tomes of Delphi 3: Win32 Core API Help File by Larry Diehl