DPayne

Hey!

I'm upgrading a Win2K/XP MFC/Win32 (no .NET) application to give it a more modern look and feel when running in Vista. I use Visual Studio 2005 C++ and have the February 2003 Platform SDK loaded.

The application uses a CDialogBar derived class with an override added for CalcDynamicLayout() so that the dialog bar will always take up all available vertical or horizontal space in the main frame depending on its orientation.

The calculation to figure out how much space is available is off by the new border padding used by the Aero theme so the dialog bar is getting cut off on the right side. If I could just get my hands on the size of that border padding, I could subtract it out and get the correct available size. After digging on MSDN, I found that the GetSystemMetrics() call was updated for Vista, providing a new index, SM_CXPADDEDBORDER, to get that size.

Since I have the Feb 2003 SDK loaded, SM_CXPADDEDBORDER isn't defined so I added my own #define to set it to 92, which is the number shown in the documentation on http://msdn2.microsoft.com/en-us/library/ms724385.aspx. The DLL involved is user32.dll. The documentation also states that if the function fails, the return value is 0. My problem is that I'm ALWAYS getting 0, even when running on Vista. I would have thought that the user32.dll supplied with Vista should support this call.

Has anyone else run into this Anyone have any clues or suggestions

Thanks!

Diane



Re: General Windows Vista Development Issues GetSystemMetrics( SM_CXPADDEDBORDER );

ARisely

I have the exact same issue. Always getting 0 whether I am running on XP or Vista.

Apparently .NET 3.0 supports the PADDED BORDER, however this would mean incorporating the code into a .NET app and at present I would like to add the detection to an existing VB 6.0 app.

Cosmetic changes to the OS are great but only if you know they are there!!!!

Do Microsoft fix user32.dll issues this minor or does it just get accepted as disfunctional forever