views:

1336

answers:

4

Can you use CMFCVisualManager with a dialog based application to change the applications appearance? If so how is it done?

The idea is to change the shape, colour etc. of controls such as push buttons using the MFC Feature Pack released with MSVC 2008.

+2  A: 

No, can't be done, at least not if you're talking about the Feature Pack version. Version 10 of the BCGSoft libraries do have this functionality, see for example: http://www.bcgsoft.com/bcgcontrolbarpro-versions.htm and http://www.bcgsoft.com/images/SkinnedBuiltInDlgs.jpg. The MFC feature pack is more or less the previous version of the BCGSoft libraries, MS bought a license from them.

Roel
A: 

Also, can you add a 'mfcfeaturepack' tag? I'm trying to group all the Feature Pack stuff under that tag.

Roel
A: 

You need to add the Common Controls manifest to your project resources. Here is the code for the manifest file:

<?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="Program Name"
 type="win32"
/>
<description>Description of Program</description>
<dependency>
 <dependentAssembly>
 <assemblyIdentity
   type="win32"
   name="Microsoft.Windows.Common-Controls"
   version="6.0.0.0"
   processorArchitecture="X86"
   publicKeyToken="6595b64144ccf1df"
   language="*"
 />
 </dependentAssembly>
</dependency>
</assembly>
djeidot
This will only enable the Common Controls V6 (aka Windows XP look). What the OP was after, was the 'themed' look (Office 2007 style, VS2005, or any of the others that are included in MFC Next.
Roel
A: 

I think you can have some MFC-feature-pack features by implementing OnApplicationLook on your base CDialog (check Step 4 on this page). It might be better to implement the whole OnApplicationLook method, but you can test your application simply by adding this to OnInitDialog:

CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_Silver);
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOffice2007));
CDockingManager::SetDockingMode(DT_SMART);
RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_FRAME | RDW_ERASE);
djeidot