Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I detect NT hardware profiles using the API?
Message
From
13/08/2001 15:40:51
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00542368
Message ID:
00543219
Views:
17
>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.

Really? You can see my confusion - I have zero C/C++ experience.
>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.

Well, I run it once, I get an '87' error, The parameter is incorrect.
On a second immediate run, I get a '120', This function is not supported on this system. I am testing under Win98SE, docs say it is supported. The docking info "dwDockInfo - A set of bit flags that indicate the docking state of the computer. This member can be a combination of the following values." is indicated as type DWORD. Can I really get by this easily? Thanks, Larry.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform