I need to create a combobox with an XP style IN a DLL with C++ and WIN32 API (no MFC). I managed to create the control in the DLL (by not in XP style). I managed to create XP style combobox in an exe with manifest, but it does not work in the DLL.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
In order for your DLL to load comctl v6 (the DLL that provides "XP-themed" versions of the common controls) without relying on its hosting process to have the appropriate manifest, you need to make your DLL isolation-aware.
Either use the C++ class described here in MSDN, or try #defining ISOLATION_AWARE_ENABLED=1
.
回答2:
In order to force your control to use XP themed rendering regardless if it's enabled in a manifest or not you will need to use visual styles API. This is available on XP and above and provides support for rendering most common controls. More information on using the API can be found here.