Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I detect NT hardware profiles using the API?
Message
 
 
To
13/08/2001 14:08:48
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00542368
Message ID:
00543186
Views:
17
This message has been marked as the solution to the initial question of the thread.
>OK, second attempt. The function I need access to is GetCurrentHwProfile, which uses the HW_PROFILE_INFO structure. I have downloaded Cristof Lange's struct.vcx, and it appears what I want is doable. However, I will admit that I am way over my head here. Can anyone provide a VFP translation for me?

Jim,
Because all parts of the structure are fixed length, you don't really need Struct or Ed Rauh's CLSHEAP classes. You can pass the function a string.
declare integer GetCurrentHwProfile in advapi32 string@
declare integer GetLastError in kernel32
lcdocked = chr(1)+replicate(chr(0),3)  && equates to desktop computers (always docked)
lcguid = replicate(chr(0),39)  && room for GUID identifier along with brackets and null terminator
lcname = replicate(chr(0),80)  && room for name of profile (80 character limit)
lcstruct = lcdocked+lcguid+lcname
if GetCurrentHwProfile(@lcstruct) <> 0 then
  * it worked
  ? substr(lcstruct,4,39)  && prints GUID identifier
  ? substr(lcstruct,44,80) && prints name of profile with trailing null terminiators (you can trim these using at() to find first occurrence)
else
  ? GetLastError()
endif
HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform