Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


December 12, 2002

Controlling Application Appearance


RSS
Subscribe to Windows IT Pro | See More Development Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

In the July 11, 2002, Dot-Tech Perspectives, "Assemblies in .NET Applications" (see the URL below), I discussed how applications based on the .NET architecture use assemblies and manifests to run. Assemblies, as you'll recall, are the executable code for these applications, whereas manifests contain settings that control the application's presentation: security settings, versioning information, and the like. However, one thing I didn't mention is that the manifest can also control the way an application looks on the screen.
http://www.winnetmag.com/articles/index.cfm?articleid=25888

If you've used any Windows OS for longer than 5 minutes and have an ounce of curiosity, you might wonder how an application's manifest affects its appearance. After all, if you're running applications on Windows XP, you can change everything—even the appearance of the control buttons in application windows—from the Control Panel Display applet. However, what you might not have noticed is that not all applications respond in the same way to the settings that you choose. When you turn on the XP theme, for example, some applications will use the bright red and blue controls that characterize XP (unless you're a curmudgeon as I am and switched to Windows Classic View when you first started your XP machine). Some applications, however, won't use these controls. They'll use some of the color and appearance settings that you can control from the Display applet, but not all of them, even if those settings are specified in the theme you've loaded.

Why don't themes apply uniformly to all applications? The answer lies with the visual styles, not with the theme. Themes, a set of configuration settings contained in a .theme file that an application's Independent Software Vendor (ISV) provides, have been around since the Microsoft Plus! Pack for Windows 95. Themes include not only visual settings but also sounds. Visual styles, which Microsoft introduced with XP, have a subtler but more encompassing effect by determining the controls available to Windows applications. All applications running on XP have a nonclient area, which includes the window frame and scroll bars. The rest of the application's graphical interface, including Windows controls, is its client area. The graphical display engine applies a visual style to the nonclient area by default, but not to the client area. So, an application's title bar changes with the theme, but the control buttons for the application's window (e.g., Close or Minimize) might not change if the application isn't configured to use visual styles. Visual styles can affect an application's client area only if that application refers to the library of controls in ComCtl32.dll 6.0 or later, which is available only with XP and later OSs. Otherwise, the application uses the earlier version of the control library that's available to earlier Windows versions.

So, how do you make ComCtl32.dll available to an application? You—or, more precisely, an application's developer—set this mechanism in one way for applications that can use third-party extensions (such as plugins) and in another way for those that can't. However, regardless of the application's structure, the purpose of an application's manifest is to describe the components that are required to run the application, including any dependencies. In this case, the dependencies will include the library of visual styles. The application's type doesn't affect the structure of the manifest—the type just affects the code that the application needs to identify the manifest.

End of Article



Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
10 Reasons to Deploy Windows Vista

The decision to upgrade your XP systems to Vista is simple when you consider features such as easier backup, a great desktop search, and vastly improved security options. ...

10 Reasons Not to Deploy Windows Vista

The decision to upgrade to Vista has to make business sense, but many companies find the costs in training and application compatibility problems outweigh any benefits Vista brings. ...

WinInfo Short Takes: CES 2009 Special Edition

An often irreverent look at some of the week's other CES 2009 news, including covering the Vegas spectacle from the comfort of my own home, Windows 7 public beta, a weird Microsoft song application, Palm Pre, pending Microsoft mobile moves, and much more ...


Development Whitepapers Batch Job Scheduling and .NET in 2008

Batch Job Scheduling and .NET in 2008

Related Events Virtualization 101

Top 11 Reasons Why Oracle Database 11g on Windows is Right For You

Windows, Unix, Linux Interoperability

Check out our list of Free Email Newsletters!

Related .NET Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing