windows-nt/Source/XPSP1/NT/shell/themes/themedir/docs/themes.htm

103 lines
7.3 KiB
HTML
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
<HTML xmlns:ph="http://placeholder"><HEAD><TITLE>User Experience Themes </TITLE><META NAME="pagetype" CONTENT="ovw"><META NAME="devlang" CONTENT="''"><META NAME="src" CONTENT="/overview/themes.xml"><META NAME="MS-HAID" CONTENT="_inet_themes_overview"><META NAME="description" CONTENT=""><META NAME="robots" CONTENT="all"><META NAME="MS.LOCALE" CONTENT="EN-US"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><LINK REL="stylesheet" TYPE="text/css" HREF="../css/ie4.css"><!-- @ -->
<LINK REL="stylesheet" TYPE="text/css" HREF="../css/inetsdk.css"><!-- @ -->
<STYLE TYPE="text/css">
PRE.clsCode { font-size:110%; }
PRE.clsSyntax { font-size:100%; }
TD DIV.clsBeta { display:none;}
p.PageHeader, li.PageHeader, div.PageHeader
{mso-style-name:"Page Header";
mso-style-parent:header-page;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:1.0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:18.0pt;
font-family:"Trebuchet MS";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Times New Roman";
color:#6699FF;}
p.header-pagesub, li.header-pagesub, div.header-pagesub
{mso-style-name:header-pagesub;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:1.0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Trebuchet MS";
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Times New Roman";
color:#6699FF;
font-style:italic;}
</STYLE>
<SCRIPT>
//<!--
var gbDBG = false;
//--></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">
//<!--
var gsHTCPath = "../code/";
//--></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">
//<!--
var gsContextMenuPath = gsHTCPath + "contextmenu.htc";
var gsCodeDecoPath = gsHTCPath + "codedeco.htc";
//--></SCRIPT><SCRIPT LANGUAGE="JavaScript1.2" SRC="../code/common.js">
//<!--
//--></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2" SRC="../code/browdata.js">
//<!--
//--></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">
//<!--
function InitPage()
{
if (!assert( (typeof(oBD) == 'object' && oBD != null), "browdata object unavailable!") )
{
return;
}
if ("MSIE" == oBD.browser && oBD.majorVer >= 4)
{
if (typeof(PreInit) == 'function') PreInit();
if (typeof(PostGBInit) == 'function') PostGBInit();
if (typeof(PostInit) == 'function') PostInit();
}
}
function assert(bCond, sMsg)
{
if (bCond) { return true; }
else { if (gbDBG) { alert(sMsg); } return false; }
}
window.onload = InitPage;
//--></SCRIPT><ph:chm></ph:chm><ph:data><XML ID="_topicdata" pubpath="/userex/overview/themes.htm" name="User Experience Themes" proj="userex" pagetype="ovw"><!-- topic data --><root></root></XML></ph:data></HEAD><BODY TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" BGCOLOR="#FFFFFF" TEXT="#000000"><DIV CLASS="clsDocBody">
<p class=PageHeader style='margin-right:.5in'>User Experience Themes</p>
<p class=header-pagesub>Whistler User Experience</p>
<P>
<HR SIZE="1"><DIV CLASS="clsBeta">
This is preliminary documentation and is subject to change.</DIV><p>The User Experience controls are a new control set based on the Microsoft<66> Win32<33> common controls and user controls. This control set has a new functionality, referred to as themes. The look and feel of theme-aware controls can change based on the selected system themes.
</p><P>The following topics are discussed in this article.</P><UL><LI><A HREF="#What_are_themes">What are themes?</A></LI><LI><A HREF="#Why_use_themes">Why use themes?</A></LI><LI><A HREF="#How_do_I_Use_Themes">How do I use themes?</A></LI><LI><A HREF="#User_Experience_Theme_API">User Experience Theme API</A></LI></UL><H2><A NAME="What_are_themes"></A>What are themes?</H2><p>You can take advantage of theme capability and produce controls that query the system for theme information. Based on the specifications of a theme, the system displays different visual appearances. Using the User Experience controls makes your application theme-aware; therefore you can tailor your application's appearance to suit your audience. For example, the business and consumer releases of Whistler could implement themes to produce different user interfaces to distinguish the two products. The Microsoft<66> Windows<77> 2000 Appearance dialog in display settings allows the user to change colors, fonts, and sizes of selected desktop elements. The User Experience controls provide even more control over the desktop. They enable the system to make changes to any theme-aware control or window.</p><H2><A NAME="Why_use_themes"></A>Why use themes?</H2><p>The User Experience Theme library, or UxTheme.lib, is a rendering library that separates the visual element of a control from its functionality. Using this library, a control can retrieve its appearance from the current system theme without you writing specialized code.
</p><p>UxTheme.lib is used by the new Common Controls to take advantage of system themes. ComCtl32.dll, version 6, queries UxTheme.lib for appropriate dimensions, sizes, and other pertinent information about a control. The dynamic-link library (DLL) calls the UxTheme library to render the parts of a control or surface. Using UxTheme, you can define the rendering of icons, borders, controls, and other user interface (UI) elements.
</p><H2><A NAME="How_do_I_Use_Themes"></A>How do I use themes?</H2><p>To use themes in your application take the following steps:</p><ol><li>Author a theme-aware control.</li><li>Add a schema to describe the parts of the control displayed in specified states.</li><li>Make the control code theme-aware by:
<ul><li>Retrieving the HTHEME handle with <A HREF="../reference/functions/openthemedata.htm">OpenThemeData</A></li><li>Calling the UxTheme functions to draw elements such as background, text, and lines.</li><li>Writing controls that use the DrawThemeXXX functions for rendering. <DIV CLASS="clsNote"><B>
Important</B>&nbsp;&nbsp;Use the lower level functions, such as GetThemeXXX, only when higher lever functions do not suffice. </DIV></li><li>Including code to provide backup drawing when
HTHEME=NULL.</li></ul></li><li>To change the theme, the system enumerates the installed themes, selects the appropriate one, and loads it.
</li><li>To load a theme, the theme loader does the following:
<ul><li>Loads the theme information, if available and valid, from the cache.</li><li>Parses the theme files.</li><li>Writes data to a shared memory map file.</li><li>Sends WM_THEMECHANGED message to all windows.</li></ul></li><li>All applications have nonclient area and dialog background theme support, by default. Applications that are linked to ComCtl32.dll, version 6, will have their standard and common controls made theme-aware.
</li><li>When themes are used with a control the following occurs:
<ul><li>The control receives a WM_THEMECHANGED message.</li><li>If HTHEME is not NULL, drawing functions draw the control parts such as the background and text.</li></ul></li></ol><H2><A NAME="User_Experience_Theme_API"></A>User Experience Theme API</H2><p>The UxTheme API provides functions for opening and closing the theme data files, as well as a number of drawing and measuring functions. For the UxTheme reference, see <A HREF="../reference/reference.htm">User Experience Themes and Controls Reference</A></p></DIV><DIV CLASS="clsFooter">
<HR SIZE="1"><BR>
&copy; <A CLASS="clsIncCpyRt" HREF="http://www.microsoft.com/misc/cpyright.htm" TARGET="_top">2000 Microsoft Corporation. All rights reserved. Terms of use</A>.
</DIV>
</BODY></HTML>