0

I have a MFC wizard based application (CPropertySheet, CPropertyPage) created with vS2008. I am trying to give my app which is nearly completed a more modern look. I looked into CDHTMLDIalog but it looks like a lot of work and not too well documented. Next I thought I could use some of the features of the Feature Pack. I found a thread about this link text but have added the code mentioned in the thread to various places in my app but the appearance never changes.

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);

Have also replaced CPropertySheet with CMFCPropertySheet & CPropertyPage with CMFCPropertyPage

Thanks...

Community
  • 1
  • 1
Canacourse
  • 1,805
  • 2
  • 20
  • 37

2 Answers2

2

Define 'give my app more modern look'. I'm assuming you're not talking XP-style common controls here, but a different wizard layout. Do you want a header/banner graphic at the top or left side of your wizard? Look at the configuration parameters for the property sheet in m_psh.dwFlags : PSH_WIZARD97, PSH_WATERMARK, PSH_HEADER, ...

If you're talking about using the modern Office-style 'skins' for your wizard (Feature Pack style), you're out of luck. Can't do that for dialogs with the Feature Pack. Look into BCG Controls - it'll cost money but it's more up to date and you get extra features.

If it's something completely different what you want, please post mockups of what it should look like, and/or a screenshot of what it looks like now and what you don't like about it.

Roel
  • 19,338
  • 6
  • 61
  • 90
  • I thought I might be able to obtain a different look for my wizard based application with the Feature Pack. You have have confirmed what I was beginning to suspect. I'll have a look at BCG Controls. Thanks... – Canacourse Oct 24 '09 at 11:31
0

You should have:

  • CWinApp replaced with CWinAppEx in your main program file;
  • The Windows Common Controls 6.0 manifest implemented (either a RT_MANIFEST resource or a #pragma entry in your stdafx.h)
  • The code below at the beginning of the InitInstance() method (this code should have been added in the New Project wizard):

    // InitCommonControlsEx() is required on Windows XP if an application
    // manifest specifies use of ComCtl32.dll version 6 or later to enable
    // visual styles.  Otherwise, any window creation will fail.
    INITCOMMONCONTROLSEX InitCtrls;
    InitCtrls.dwSize = sizeof(InitCtrls);
    // Set this to include all the common control classes you want to use
    // in your application.
    InitCtrls.dwICC = ICC_WIN95_CLASSES;
    InitCommonControlsEx(&InitCtrls);
    
djeidot
  • 4,542
  • 4
  • 42
  • 45
  • Yes. I have replaced CWinApp with CWinAppEx. – Canacourse Oct 19 '09 at 14:14
  • Please check my answer again, I included a few more sugestions – djeidot Oct 20 '09 at 14:33
  • I had a problem of a Split Button Control that was working correctly in Windows 7 and Vista, but not in XP. It doesn't even appear in the form where I had put it! So I replaced it with a Is it previsible that it a MFC Menu button, that compared with the split button, is very ugly. My question: Adding these lines, is it predictable that the split button would work? – sergiol Jul 12 '12 at 08:48