Retrieves information about the current hardware profile for the local computer.
[DllImport("advapi32.dll", SetLastError=true)]
static extern bool GetCurrentHwProfile(IntPtr fProfile);
[StructLayout(LayoutKind.Sequential)]
class HWProfile
{
public Int32 dwDockInfo;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 39)]
public string szHwProfileGuid;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szHwProfileName;
}
Do you know one? Please contribute it!
None.
Please add some!
IntPtr lHWInfoPtr = Marshal.AllocHGlobal(123);
HWProfile lProfile=new HWProfile();
Marshal.StructureToPtr(lProfile,lHWInfoPtr,false);
if (GetCurrentHwProfile(lHWInfoPtr)) {
Marshal.PtrToStructure(lHWInfoPtr, lProfile);
string lText=lProfile.szHwProfileGuid.ToString();
}
Marshal.FreeHGlobal(lHWInfoPtr);