Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am a little confused on what are the factors that contribute to the appearance of the UI elements (like buttons) on windows dialogs. My confusion appears out of the following observations:

1- I have visual studio 2010 installed on my system and when I create a MFC dialog , the buttons on the .rc have a sophisticated look , slightly rounded corners etc. when I build the MFC application same appearance comes in the resulting exe.

2- Now I get an application that is developed in VC 6, convert it to new vs 2010 project. When I open the .rc file the UI look is same as described above.but when I build and run the app , the ui look of the buttons is old , unsophisticated.

3- I include InitcommonControlEx() in the old code , and that changes nothing.Perhaps it is not related to this.

My question is what is controlling this look and feel of the ui elements? Is it something to do with the manifest file which directs which version of windows library the application should use?

if so, how can I update the manifest file of the old project , so that I get the new UI look and feel?
Posted

1 solution

Please add the following compiler directive to specify manifest file attributes.

C++
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif


Please refer the msdn link to change the visual styles.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb773175%28v=vs.85%29.aspx[^]
 
Share this answer
 
v2
Comments
kaushik_code 14-Apr-13 3:31am    
That precisely solves the problem.Thank you. I was seeking one more advise as to how to make a button owner draw and still retain the 3-d look. Any help on this regard will also be much appreciated. Ques: http://www.codeproject.com/Questions/577338/MFCplus-plusmakingplusapluscoloredplusbutton

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900