【常用WinAPI】系统信息类
一、系统路径
展开环境变量:ExpandEnvironmentStrings
获取System/System32路径:GetSystemDirectory
获取Windows路径:GetWindowsDirectory(多用户环境要使用GetSystemWindowsDirectory)
二、系统名称
获取计算机名:GetComputerName
设置计算机名:SetComputerName
获取用户名:GetUserName
三、系统参数
返回或设置系统参数:SystemParametersInfo
四、系统个性化信息
获取系统颜色:GetSysColor
设置系统颜色:SetSysColor
获取系统尺寸:GetSystemMetrics
获取键盘类型:GetKeyboardType
五、系统版本信息
获取简单系统版本:GetVersion(Win8.1+失效,需使用VerifyVersionInfo/RtlGetVersion)
获取详细系统版本:GetVersionEx(Win8.1+失效,需使用VerifyVersionInfo/RtlGetVersion)
获取系统信息:GetSystemInfo(64位系统要使用GetNativeSystemInfo)