Windows with C++: Windows Vista Control Enhancements

The August 2007 issue of MSDN Magazine is out and features my new column entitled Windows with C++. It will initially be published every other month and focuses on Windows Vista and Windows Server 2008 development using C++. As with my Cryptography Next Generation article, each column includes a “What about .NET?” sidebar that showcases how the various techniques discussed in the article can be used from managed code using either C# or C++/CLI.

The first column introduces many of the control enhancements introduced in Windows Vista.

Windows with C++: Windows Vista Control Enhancements

Windows Vista doesn’t introduce many new controls (though it does provide the new Network Address Control, which allows input and validation of IPv4, IPv6, and DNS names), but it offers a number of enhancements and new features to many of the existing standard and common controls. This is good news in a way because it means you can take advantage of many of these new features in your applications with very little effort. In this column, I am going to take you on a whirlwind tour through some of the most commonly used controls and look at various new and exciting features that are provided by Windows Vista and beyond.

Enjoy!

(The various screenshots in this issue don’t look too good online. Hopefully the print edition is in better shape.) Fixed!

If you’re looking for one of my previous articles here is a complete list of them for you to browse through.

© 2007 Kenny Kerr

10 Comments

  • You know, there is this great program that I found for doing screenshots in Vista called Window Clippings. Maybe you've heard about it.

    :-)

  • Thanks Tim... :)

    The screenshots were taken using Window Clippings but it looks like they were distorted along the way. Anyway, Mike over at MSDN Magazine has since updated the screenshots with the originals I sent them.

  • The code for the article is a sfx wrapped in another sfx hehe (I know the outer sfx is the normal signed ms sfx, not sure about the other one)

  • and since this is a Vista sample, why use Tahoma as the font instead of the fake ms shell dlg font for auto font selection?

  • ac: I checked the download and it works fine. The shell dialog fonts don’t work as expected on Vista.

  • Officially, you're not supposed to use MS Shell Dlg on Vista. You have to explicitly put Segoe UI in your dialog resources. Or, in a more realistic world where we want our apps to run on pre-Vista OSes, detect the OS and tweak the resource in memory to have MS Shell Dlg on pre-Vista and Segoe UI on Vista. Yes, it's as big of a pain as you think. :/

  • Mike: yep, it’s a real pain in native code. I’m toying with simply shipping 2 versions of each dialog resource. It’s slightly less painful but not especially convenient.

  • Replacing the Font in mem is no good, Segoe is supposed to be 9pt, will probably cause size problems, unless you resize every control and dialog and not just the font

  • I'm thinking about ditching dialog resources completely and writing code which does all the layout from a table of data in the code.

    This would solve the problems of font size dependence as well as mean I no longer have to use the terrible dialog editor in Visual Studio (which doesn't even attempt to help you lay out different controls according to the official guidelines about spacing between different elements -- you have to remember the rules and position things by hand which is ridiculous).

    I find it annoying that the tools for Windows GUI developers are still so awful. :(

    Or have I missed a trick?

  • Leo: What we need is a XAML designer that facilitates this (http://msdn.microsoft.com/en-us/library/aa511258.aspx) and a static analysis tool that can verify your XAML for compliance. Time to write some code! :)

    Visual C# is the closest commercial tool today in the Microsoft tools stable. It is far superior to Visual C++ as far as design-time support goes.

Comments have been disabled for this content.