Red Gate forums :: View topic - #if (WINVER >= 0x0600)
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
PInvoke.Net
PInvoke.Net forum

#if (WINVER >= 0x0600)

Search in PInvoke.Net forum
Post new topic   Reply to topic
Jump to:  
Author Message
ionymous



Joined: 15 May 2009
Posts: 1

PostPosted: Fri May 15, 2009 4:00 pm    Post subject: #if (WINVER >= 0x0600) Reply with quote

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.
Ion
Back to top
View user's profile Send private message
theloon



Joined: 03 Sep 2009
Posts: 2

PostPosted: Thu Sep 03, 2009 9:52 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group