Discussion:
Constants Missing From Windows Header Files?
(too old to reply)
CyberSimian
2012-04-19 10:50:51 UTC
Permalink
Raw Message
I am in the process of writing an application to manipulate power plans on
Windows Vista and Windows 7 (the "PowerXxx()" family of API calls, defined in
the Windows header file "powrprof.h"). As this is a new area for me, I
googled for some sample code, and found a snippet that used this constant (at
least, I think that it is a constant!):

GUID_DISK_SUBGROUP

However, I could not find this defined anywhere in the Open Watcom Windows
headers (including the DDK headers). So I used the command "POWERCFG.EXE
/QUERY" to query the current power plan, which displays the current settings
AND their guids, and got the guid for the disk subgroup from there, and this
enabled me to get the code snippet to compile and run. But there are lots of
guids associated with power plans. Shouldn't they be defined in an OW Windows
header file somewhere? Thanks.

-- from CyberSimian in the UK
Uwe Schmelich
2012-04-19 11:17:35 UTC
Permalink
Raw Message
Post by CyberSimian
I am in the process of writing an application to manipulate power plans on
Windows Vista and Windows 7 (the "PowerXxx()" family of API calls, defined in
the Windows header file "powrprof.h"). As this is a new area for me, I
googled for some sample code, and found a snippet that used this constant
GUID_DISK_SUBGROUP
--snip--
Post by CyberSimian
Shouldn't they be defined in an OW Windows header file somewhere? Thanks.
-- from CyberSimian in the UK
They should be in winnt.h. However OW isn't on par with MS VC for Windows
programming. If you need newer stuff you should get the Win7 SDK from
Microsoft (it's freely downloadable). Therein you will find the GUID's you
need.
CyberSimian
2012-04-20 10:29:27 UTC
Permalink
Raw Message
Post by Uwe Schmelich
If you need newer stuff you should get the Win7 SDK from
Microsoft (it's freely downloadable).
I did not know that (I had assumed that one had to purchase the SDK).
Thank you.

-- from CyberSimian in the UK
Lynn McGuire
2012-04-20 16:56:54 UTC
Permalink
Raw Message
Post by Uwe Schmelich
Post by CyberSimian
I am in the process of writing an application to manipulate power plans on
Windows Vista and Windows 7 (the "PowerXxx()" family of API calls, defined in
the Windows header file "powrprof.h"). As this is a new area for me, I
googled for some sample code, and found a snippet that used this constant
GUID_DISK_SUBGROUP
--snip--
Post by CyberSimian
Shouldn't they be defined in an OW Windows header file somewhere? Thanks.
-- from CyberSimian in the UK
They should be in winnt.h. However OW isn't on par with MS VC for Windows
programming. If you need newer stuff you should get the Win7 SDK from
Microsoft (it's freely downloadable). Therein you will find the GUID's you
need.
Hmmm. The Windows SDK is freely downloadable again:
http://www.microsoft.com/download/en/details.aspx?id=3138
If I remember correctly, it was not free for Windows
XP.

Lynn
Roald Ribe
2012-04-21 14:28:42 UTC
Permalink
Raw Message
Post by Lynn McGuire
Post by Uwe Schmelich
Post by CyberSimian
I am in the process of writing an application to manipulate power plans on
Windows Vista and Windows 7 (the "PowerXxx()" family of API calls, defined in
the Windows header file "powrprof.h"). As this is a new area for me, I
googled for some sample code, and found a snippet that used this constant
GUID_DISK_SUBGROUP
--snip--
Post by CyberSimian
Shouldn't they be defined in an OW Windows header file somewhere? Thanks.
-- from CyberSimian in the UK
They should be in winnt.h. However OW isn't on par with MS VC for Windows
programming. If you need newer stuff you should get the Win7 SDK from
Microsoft (it's freely downloadable). Therein you will find the GUID's you
need.
http://www.microsoft.com/download/en/details.aspx?id=3138
If I remember correctly, it was not free for Windows
XP.
http://www.microsoft.com/download/en/details.aspx?id=8279
This one is newer than the one you linked to.
For those who would like to have it on a DVD there is an ISO download
further down the page.

Outside of Microsoft the OW headers are the most complete anywhere, AFAIK.
I think they were complete as of Vista, but new information is added in every
Windows release.

Roald
Lynn McGuire
2012-04-23 16:12:05 UTC
Permalink
Raw Message
Post by Roald Ribe
Post by Lynn McGuire
Post by Uwe Schmelich
Post by CyberSimian
I am in the process of writing an application to manipulate power plans on
Windows Vista and Windows 7 (the "PowerXxx()" family of API calls, defined in
the Windows header file "powrprof.h"). As this is a new area for me, I
googled for some sample code, and found a snippet that used this constant
GUID_DISK_SUBGROUP
--snip--
Post by CyberSimian
Shouldn't they be defined in an OW Windows header file somewhere? Thanks.
-- from CyberSimian in the UK
They should be in winnt.h. However OW isn't on par with MS VC for Windows
programming. If you need newer stuff you should get the Win7 SDK from
Microsoft (it's freely downloadable). Therein you will find the GUID's you
need.
http://www.microsoft.com/download/en/details.aspx?id=3138
If I remember correctly, it was not free for Windows
XP.
http://www.microsoft.com/download/en/details.aspx?id=8279
This one is newer than the one you linked to.
For those who would like to have it on a DVD there is an ISO download
further down the page.
Outside of Microsoft the OW headers are the most complete anywhere, AFAIK.
I think they were complete as of Vista, but new information is added in every
Windows release.
Roald
Cool ! I doubt that the OW headers are x64 aware
though and that is where all new stuff is heading.

Lynn

Loading...