Normal looking button with c++ / win32

前端 未结 4 1305
忘掉有多难
忘掉有多难 2021-01-22 01:27

I\'m trying to make a button but it always looks like windows 95 flat button. How do I make it look vista style?

    hWndEdit = CreateWindowA(\"button\", \"Test\         


        
4条回答
  •  盖世英雄少女心
    2021-01-22 02:03

    What is your build environment? If its Visual Studio 2005 or 2008, then all the other manifest advice does not apply as VS8 and up are already including manifest information.

    In which case the easiest way to add a manifest dependency is to make use of a simple (microsoft specific) compiler directive that you add to some cpp or header file:

    #pragma comment(linker,"/manifestdependency:\"type='win32' "\
                       "name='Microsoft.Windows.Common-Controls' "\
                       "version='6.0.0.0' "\
                       "processorArchitecture='x86' "\
                       "publicKeyToken='6595b64144ccf1df' "\
                       "language='*' "\
                       "\"")
    

    Including the manifest this way avoids messing up the c-runtime manifest dependencies or messing up the settings needed for UAC to work correctly.

提交回复
热议问题