#if (WINVER >= 0x0600)

Announcements and discussion for PInvoke

#if (WINVER >= 0x0600)

Postby ionymous » Fri May 15, 2009 3:00 pm

I'm using SystemParametersInfo to get NONCLIENTMETRICS, as demonstrated here.

It is working for me in XP, but I suspect it might have problems in Vista. (I hope to test this soon).

According to this msdn page, "int iPaddedBorderWidth" has been added to the structure for Vista and later.
So, MS suggests using "#if (WINVER >= 0x0600)" within the struct.

But in C# I can't use a preprocessor conditional with >=.

How do I work around this?
Thanks for any help.
Posts: 1
Joined: Fri May 15, 2009 2:30 pm

Postby theloon » Thu Sep 03, 2009 8:52 pm

You could try:

Declare a new structure which contains the additional member, eg NONCLIENTMETRICS_VISTA.
Declare a new method signature which takes the new structure in place of the old.
When running on Vista use the new signature otherwise use the old.
Posts: 2
Joined: Thu Sep 03, 2009 8:44 pm

Return to PInvoke.Net

Who is online

Users browsing this forum: No registered users and 0 guests