• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            天行健 君子當(dāng)自強(qiáng)而不息

            Using Windows XP Visual Styles

            Using Microsoft Windows XP, you can now define the visual style or appearance of controls and windows from simple colors to textures and shapes. You can control each defined part of a control as well as each part of the nonclient (frame and caption) area of a window. The user can then use the Appearance tab in the Windows Control Panel to switch between the classic visual style and other available styles.

            A visual style is included with the Windows XP release. Using helper libraries and application programming interfaces (APIs), you can incorporate the Windows XP visual style into your application with few code changes. For information about the differences between themes and visual styles, see Themes and Visual Styles.


             

            ComCtl32.dll Version 6

            All applications running on the Windows XP operating system have a nonclient area, which includes the window frame and nonclient scroll bars. A visual style is applied to the nonclient area by default. This means that the appearance of the nonclient area is specified by the visual style that is currently installed. To apply a visual style to common controls in the client area, you must use ComCtl32.dll version 6 or later. Unlike earlier versions of ComCtl32.dll, version 6 is not redistributable. The only way you can use version 6 of the dynamic-link library (DLL) is to use an operating system that contains it. Windows XP ships with both version 5 and version 6. ComCtl32.dll version 6 contains both the user controls and the common controls. By default, applications use the user controls defined in User32.dll and the common controls defined in ComCtl32.dll version 5.

            If you want your application to use visual styles, you must add an application manifest that indicates that ComCtl32.dll version 6 should be used if it is available. Version 6 includes some new controls and new options for other controls, but the biggest change is support for changing the appearance of controls in a window.

            Using Manifests to Ensure That Visual Styles Can Be Applied to Applications

            As previously discussed, you must use ComCtl32.dll version 6 to apply visual styles to your applications and use an application manifest to ensure that version 6 is available to your application. An application manifest describes an application and specifies the components required to run the application, such as any dependencies.

            You must use Extensible Markup Language (XML) to write a manifest. The name of the application manifest file is the name of your executable followed by the file extension .manifest. For example, MyApp.exe.manifest. The following sample manifest shows that the first section describes the manifest itself. The following table shows the attributes set by the assemblyIdentity element in the manifest description section.


             

            Attribute Description
            version Version of the manifest. The version must be in the form major.minor.revision.build (that is, n.n.n.n, where n <=65535).
            processorArchitecture Processor for which your application is developed.
            name Includes company name, product name and application name.
            type Type of your application, such as Microsoft Win32.


             

            The sample manifest also provides a description of your application and specifies application dependencies. The following table shows the attributes set by the assemblyIdentity element in the dependency section.


             

            Attribute Description
            type Type of the dependency component, such as Win32.
            name Name of the component.
            version Version of the component.
            processorArchitecture Processor that the component is designed for.
            publicKeyToken Key token used with this component.
            language Language of the component.

            Following is an example of a manifest file.

            Important  If you write an application for the 64 bit Windows platform, you must change the processorArchitecture entry to processorArchitecture="IA64".
            <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
            <assemblyIdentity
            version="1.0.0.0"
            processorArchitecture="X86"
            name="CompanyName.ProductName.YourApplication"
            type="win32"
            />
            <description>Your application description here.</description>
            <dependency>
            <dependentAssembly>
            <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="X86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
            />
            </dependentAssembly>
            </dependency>
            </assembly>

            The following topics describe the steps for applying visual styles to different types of applications. Notice that the manifest format is the same in each case.

            Using ComCtl32.dll Version 6 in an Application That Does Not Use Third Party Extensions

            The following are examples of applications that do not use third party extensions.

            • Calculator
            • FreeCell
            • Minesweeper
            • Notepad
            • Solitaire

            To create a manifest and enable your application to use visual styles.

            1. Link to ComCtl32.lib and call InitCommonControls.
            2. Add a file called YourApp.exe.manifest to your source tree that has the XML manifest format.
              <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
              <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
              <assemblyIdentity
              version="1.0.0.0"
              processorArchitecture="X86"
              name="CompanyName.ProductName.YourApplication"
              type="win32"
              />
              <description>Your application description here.</description>
              <dependency>
              <dependentAssembly>
              <assemblyIdentity
              type="win32"
              name="Microsoft.Windows.Common-Controls"
              version="6.0.0.0"
              processorArchitecture="X86"
              publicKeyToken="6595b64144ccf1df"
              language="*"
              />
              </dependentAssembly>
              </dependency>
              </assembly>
            3. Add the manifest to your application's resource file as follows:
              CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.exe.manifest"
              Note  When you add the previous entry to the resource you must format it on one line. Alternatively, you can place the XML manifest file in the same directory as your application's executable file. The operating system will load the manifest from the file system first, then check the resource section of the executable. The file system version takes precedence.

            posted on 2007-11-05 02:56 lovedday 閱讀(876) 評(píng)論(0)  編輯 收藏 引用 所屬分類: ▲ Software Program

            公告

            導(dǎo)航

            統(tǒng)計(jì)

            常用鏈接

            隨筆分類(178)

            3D游戲編程相關(guān)鏈接

            搜索

            最新評(píng)論

            国产一区二区三区久久| 94久久国产乱子伦精品免费| 久久青青草视频| 久久天天躁夜夜躁狠狠| 久久99热只有频精品8| 久久久久亚洲爆乳少妇无| 久久无码专区国产精品发布| 国产精品九九九久久九九| 国产精品99久久久久久宅男| 狠狠综合久久AV一区二区三区| 久久96国产精品久久久| 伊人色综合久久天天人守人婷 | 欧美久久亚洲精品| 人妻无码久久一区二区三区免费| 国产L精品国产亚洲区久久| 久久久久精品国产亚洲AV无码| 久久er热视频在这里精品| 久久精品国产99国产精品导航| 国产激情久久久久影院小草| 久久99热只有频精品8| 久久婷婷色香五月综合激情 | 国产高潮国产高潮久久久| 蜜桃麻豆www久久国产精品| 国产精品视频久久久| 一本色道久久88精品综合| 欧美日韩中文字幕久久久不卡| 久久久久亚洲精品天堂| 99久久无色码中文字幕人妻| 欧美麻豆久久久久久中文| 久久综合伊人77777| 国产精品日韩欧美久久综合| 久久精品免费观看| 久久99国产精品久久久| 精品免费tv久久久久久久| 2021久久国自产拍精品| 久久久精品人妻一区二区三区四| 亚洲AV无码1区2区久久| 亚洲中文字幕无码久久精品1| 久久只这里是精品66| 久久成人国产精品免费软件| 久久中文字幕精品|