c++mfcvisual-styles

Why visual style is disabled in CDHtmlDialog


I've created an MFC html dialog based application the dialog inherits from CDHtmlDialog, all buttons on the html has classic style not the visual style, why is that?? how can i change this behaviour??? the visual style is enabled on other dialogs, In the same project when I displayed a normal dialog that inherits from CDialog it's button displayed visual style.

why is that??


Solution

  • I've found the answer in this article http://www.webdbtips.com/89962/

    add this tag to html page

    <META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">   
    

    or add the following line to the body of the class that inherits from CDHtmlDialog

    STDMETHOD(GetHostInfo)(DOCHOSTUIINFO *pInfo){pInfo->dwFlags |= DOCHOSTUIFLAG_THEME; return S_OK;};
    

    that enabled the visual style for me