术语 | getwindowsdirectory |
释义 | GetWindowsDirectory 语法: C++ UINT WINAPI GetWindowsDirectory( __out LPTSTR lpBuffer, __in UINT uSize ); GetWindowsDirectory函数 检索文件的Windows目录。在Windows目录中包含的应用程序,初始化文件,如文件和帮助文件。 此功能主要是为兼容。应用程序应存储在Program Files文件夹的代码,并在应用程序中的数据用户的配置文件夹的持久性数据。有关更多信息,请参阅的SHGetFolderPath。 参数 lpBuffer [out] 阿一个缓冲区,它接收路径的指针。这条道路并没有结束,除非以反斜杠Windows目录是根目录。例如,如果Windows目录被命名为Windows的C驱动器上的Windows目录的路径检索这个函数是C:\\窗口。如果系统在驱动器C的根目录,检索安装路径是C:\\。 uSize [in] 至于由lpBuffer参数指定的缓冲区的最大尺寸,在TCHARs。此值应设置为MAX_PATH。 返回值 如果函数成功,返回值是复制到缓冲区的字符串的长度,在TCHARs,不包括终止空字符。 如果长度大于缓冲区的大小,返回值是须持有的路径缓冲区的大小。 如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 备注 Windows目录所在的目录是一个应用程序应该存储初始化和帮助文件。如果用户运行的系统共享版本,Windows目录是保证为每个用户的私人。 如果应用程序创建,它要存储在每个用户的其他文件,它应该在的地方HOMEPATH环境变量指定的目录中。这个目录将是不同的每个用户,如果由一个通过用户管理器管理工具管理员指定。 HOMEPATH总是要么指定用户的主目录,这是保证为每个用户,或(如默认目录为C:\\用户\\默认)私营,用户将所有访问。 终端服务:如果应用是在终端服务环境中运行,每个用户都有一个私人的Windows目录。还有一个共享的Windows系统目录中。如果应用是终端的服务意识(有IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE国旗的图像头集),此函数返回该系统的Windows目录的路径,就像GetSystemWindowsDirectory函数执行。否则,它检索私人用户的Windows目录的路径。 实例 有关示例,请参见获取系统信息。 要求: 最低支持:client-Windows 2000专业版 最低支持server-Windows 2000服务器 HeaderWinbase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll Unicode和ANSI namesGetWindowsDirectoryW(Unicode)和GetWindowsDirectoryA(ANSI)的 参见 GetCurrentDirectory GetSystemDirectory GetSystemWindowsDirectory 系统信息功能 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==GetWindowsDirectory Function Retrieves the path of the Windows directory. The Windows directory contains such files as applications, initialization files, and help files. This function is provided primarily for compatibility. Applications should store code in the Program Files folder and persistent data in the Application Data folder in the user's profile. For more information, see ShGetFolderPath . Syntax C++ UINT WINAPI GetWindowsDirectory( __out LPTSTR lpBuffer, __in UINT uSize ); Parameters lpBuffer [out] A pointer to a buffer that receives the path. This path does not end with a backslash unless the Windows directory is the root directory. For example, if the Windows directory is named Windows on drive C, the path of the Windows directory retrieved by this function is C:\\Windows. If the system was installed in the root directory of drive C, the path retrieved is C:\\. uSize [in] The maximum size of the buffer specified by the lpBuffer parameter, in TCHARs. This value should be set to MAX_PATH. Return Value If the function succeeds, the return value is the length of the string copied to the buffer, in TCHARs, not including the terminating null character. If the length is greater than the size of the buffer, the return value is the size of the buffer required to hold the path. If the function fails, the return value is zero. To get extended error information, call GetLastError . Remarks The Windows directory is the directory where an application should store initialization and help files. If the user is running a shared version of the system, the Windows directory is guaranteed to be private for each user. If an application creates other files that it wants to store on a per-user basis, it should place them in the directory specified by the HOMEPATH environment variable. This directory will be different for each user, if so specified by an administrator, through the User Manager administrative tool. HOMEPATH always specifies either the user's home directory, which is guaranteed to be private for each user, or a default directory (for example, C:\\USERS\\DEFAULT) where the user will have all access. Terminal Services: If the application is running in a Terminal Services environment, each user has a private Windows directory. There is also a shared Windows directory for the system. If the application is Terminal-Services-aware (has the IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE flag set in the image header), this function returns the path of the system Windows directory, just as the GetSystemWindowsDirectory function does. Otherwise, it retrieves the path of the private Windows directory for the user. Examples For an example, see Getting System Information . Requirements Minimum supported clientWindows 2000 Professional Minimum supported serverWindows 2000 Server HeaderWinbase.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll Unicode and ANSI namesGetWindowsDirectoryW (Unicode) and GetWindowsDirectoryA (ANSI) See Also GetCurrentDirectory GetSystemDirectory GetSystemWindowsDirectory System Information Functions Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms724454(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。