Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the style of dialog box items into what appears in test mode?

When i test my dialog box in Visual Studio 2008 by CTRL+T shortcut, i can see the dialog box items with neat slick borders. But when i compile the project and launch it via the program itself, it looks "3d" style: every dialog box has shading like old Windows 98 style.

I want to use the slick 1 pixel borders that the testing mode shows. How do i enable/disable between these two styles?

Here is example of how those two styles look like, i want to use the upper one:

enter image description here

like image 758
Rookie Avatar asked Oct 09 '22 10:10

Rookie


1 Answers

STEP1 add this code to your stdafx.h:

#ifdef _UNICODE
#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_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
#endif

STEP2 on method InitInstance():

    BOOL Ctest_stylesApp::InitInstance()
{
    INITCOMMONCONTROLSEX InitCtrls;
    InitCtrls.dwSize = sizeof(InitCtrls);
    InitCtrls.dwICC = ICC_WIN95_CLASSES;
    InitCommonControlsEx(&InitCtrls);
}

I'm using Visual Studio 2010 and it works.

like image 95
Albertino80 Avatar answered Oct 13 '22 11:10

Albertino80