网站首页  词典首页

请输入您要查询的函数:

 

术语 getcurrenthwprofile
释义 GetCurrentHwProfile
语法:
C++
BOOL WINAPI GetCurrentHwProfile(
__out LPHW_PROFILE_INFO lpHwProfileInfo
);
GetCurrentHwProfile功能
获取信息的本地计算机当前硬件配置文件。
参数
lpHwProfileInfo [out]
对一个HW_PROFILE_INFO结构得到有关当前硬件配置信息的指针。
返回值
如果函数成功,返回值是一个非零值。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
该GetCurrentHwProfile函数检索的硬件配置文件的显示名称和全局唯一标识符(GUID)的字符串。该函数还检索报告的对接与扩展坞的便携式计算机的状态。
该系统生成每个硬件配置文件和注册表中的字符串其存储的GUID。您可以使用GetCurrentHwProfile检索GUID字符串用作根据您的应用程序的配置设置的注册表子项HKEY_CURRENT_USER项。这使您能够存储每个硬件配置每个用户的设置。例如,颜色控制面板应用程序可以使用的子项来存储不同的硬件配置文件,如停靠和停靠的国家概况,每个用户的色彩偏好。应用程序使用此功能可以查看当前硬件配置文件启动时,并相应地更新它们的设置。
应用程序也可以更新其设置时,系统设备信息,如DBT_CONFIGCHANGED,表明硬件配置发生了变化。
要编译的应用程序使用此函数,定义为0x0400或更高_WIN32_WINNT宏。有关详细信息,请参阅使用Windows头。
实例
#include
#include
#include
void main(void)
{
HW_PROFILE_INFO HwProfInfo;
if (!GetCurrentHwProfile(&HwProfInfo))
{
_tprintf(TEXT("GetCurrentHwProfile failed with error %lx\\n"),
GetLastError());
return;
}
_tprintf(TEXT("DockInfo = %d\\n"), HwProfInfo.dwDockInfo);
_tprintf(TEXT("Profile Guid = %s\\n"), HwProfInfo.szHwProfileGuid);
_tprintf(TEXT("Friendly Name = %s\\n"), HwProfInfo.szHwProfileName);
}
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode和ANSI namesGetCurrentHwProfileW(Unicode)和GetCurrentHwProfileA(ANSI)的
参见
DBT_CONFIGCHANGED
HW_PROFILE_INFO
系统信息功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetCurrentHwProfile Function
Retrieves information about the current hardware profile for the local computer.
Syntax
C++
BOOL WINAPI GetCurrentHwProfile(
__out LPHW_PROFILE_INFO lpHwProfileInfo
);
Parameters
lpHwProfileInfo [out]
A pointer to an HW_PROFILE_INFO structure that receives information about the current hardware profile.
Return Value
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
The GetCurrentHwProfile function retrieves the display name and globally unique identifier (GUID) string for the hardware profile. The function also retrieves the reported docking state for portable computers with docking stations.
The system generates a GUID for each hardware profile and stores it as a string in the registry. You can use GetCurrentHwProfile to retrieve the GUID string to use as a registry subkey under your application's configuration settings key in HKEY_CURRENT_USER. This enables you to store each user's settings for each hardware profile. For example, the Colors control panel application could use the subkey to store each user's color preferences for different hardware profiles, such as profiles for the docked and undocked states. Applications that use this functionality can check the current hardware profile when they start up, and update their settings accordingly.
Applications can also update their settings when a system device message, such as DBT_CONFIGCHANGED , indicates that the hardware profile has changed.
To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later. For more information, see Using the Windows Headers .
Examples
#include
#include
#include
void main(void)
{
HW_PROFILE_INFO HwProfInfo;
if (!GetCurrentHwProfile(&HwProfInfo))
{
_tprintf(TEXT("GetCurrentHwProfile failed with error %lx\\n"),
GetLastError());
return;
}
_tprintf(TEXT("DockInfo = %d\\n"), HwProfInfo.dwDockInfo);
_tprintf(TEXT("Profile Guid = %s\\n"), HwProfInfo.szHwProfileGuid);
_tprintf(TEXT("Friendly Name = %s\\n"), HwProfInfo.szHwProfileName);
}
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryAdvapi32.lib
DLLAdvapi32.dll
Unicode and ANSI namesGetCurrentHwProfileW (Unicode) and GetCurrentHwProfileA (ANSI)
See Also
DBT_CONFIGCHANGED
HW_PROFILE_INFO
System Information Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724311(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:24:25