please dont rip this site Prev Next

GetCurrentHwProfile info  Overview  Group

The GetCurrentHwProfile function retrieves information about the current hardware profile for the local computer.

BOOL GetCurrentHwProfile(

    LPHW_PROFILE_INFO lpHwProfileInfo

// receives the hardware profile information

   );

Parameters

lpHwProfileInfo
Pointer to an HW_PROFILE_INFO structure in which the function returns information about the current hardware profile.

Return Values

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.

Windows 95: Applications can also update their settings when a system device message, such as DBT_CONFIGCHANGED, indicates that the hardware profile has changed.

Example

#include <windows.h>

#include <stdio.h>

#include <tchar.h>



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);

} // main

 

See Also

DBT_CONFIGCHANGED, HW_PROFILE_INFO


file: /Techref/os/win/api/win32/func/src/f29_17.htm, 3KB, , updated: 2000/4/7 11:19, local time: 2024/11/29 17:42,
TOP NEW HELP FIND: 
3.135.184.27:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://techref.massmind.org/Techref/os/win/api/win32/func/src/f29_17.htm"> GetCurrentHwProfile</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to techref.massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .