An XP style combobox in a DLL

2020-05-07 19:34发布

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.

2条回答
Rolldiameter
2楼-- · 2020-05-07 19:50

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.

查看更多
Evening l夕情丶
3楼-- · 2020-05-07 20:00

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.

查看更多
登录 后发表回答