Skip to content

让你的程序具备XP风格

  以上说的适用于MFC,如果用win32   sdk的话,还是应该参照MSDN.  
  只不过MFC7.1把以下这些自动化了。  
   
  大意是:(我用xpstyle代表项目名)  
   
  1。做一个xml文件:xpstyle.manifest     

 
<?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.xpstyle"
          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>

   
   
  2.程序初始化时,运行  
 

InitCommonControls();  

   
  3.在resoure.h中加  
   

#define   IDR_MANIFEST CREATEPROCESS_MANIFEST_RESOURCE_ID    

   
  4.在xpstyle.rc中加  
   
 

#ifdef   _UNICODE  
  IDR_MANIFEST RT_MANIFEST "res\\xpstyle.manifest  

  #endif  
   
  5.最后还是要将项目设为UNICODE字符集编译。  
   
  6.另外,如果写dll,或者其他的,参照(MSDN2003-4)  
   
      ms-help://MS.MSDNQTR.2003APR.1033/shellcc/platform/commctls/userex/cookbook.htm#no_extensions

Post a Comment

Your email is never published nor shared. Required fields are marked *