Programming - cpueblo.com

XP 스타일로 컨트롤 변화시키기 - MFC 편


글쓴이 : 유광희 날짜 : 2003-06-02 (월) 18:28 조회 : 18650
컨트롤을 모두 XP 형태로 변화시켜 보자 XP 에서는 변화되며, 2000 이하에서는 원래 컨트롤이 출력된다 1. Resource.h 에 아래 내용을 추가 #define IDR_MANIFEST 1 #define RT_MANIFEST 24 2. InitInstance 쪽에 아래 내용을 추가 BOOL CXPStyleApp::InitInstance() { InitCommonControls(); // initialize common control library CWinApp::InitInstance(); // call parent class method // 위 2 개 함수 호출을 넣는다 // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif ... } 3. 프로젝트.rc2 파일에 아래 내용을 추가한다 ///////////////////////////////////////////////////////////////////////////// // Add manually edited resources here... IDR_MANIFEST RT_MANIFEST MOVEABLE PURE "res\\\\XPStyle.manifest" ///////////////////////////////////////////////////////////////////////////// 4. XPStyle.manifest 파일을 아래 내용을 포함하여 생성한다 _?xml_ version="1.0" encoding="UTF-8" standal&#111;&#110;e="yes"?> _ xml_ns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Microsoft.Windows.MyApplication" type="win32" /> <de&#115;&#99;ription>MyApplication</de&#115;&#99;ription> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </assembly> 5. 실행해 보면 짠