0

I am working on a legacy ActiveX control that implements custom drawing of elementary Windows controls like combo button and check box. If the Windows visual styles are available, these controls are drawn with the DrawThemeBackground function like this:

res = DrawThemeBackground(hTheme, hDC, lPartId, lStateId, rcDraw, rcDraw);

The ActiveX's initialization code contains calls to InitCommonControls/InitCommonControlsEx. Do we need these calls if OS-styled combo buttons and check boxes are not created with CreateWindowEx and are fully custom drawn?

TecMan
  • 2,743
  • 2
  • 30
  • 64
  • `InitCommonControls` never need call. this is empty api. it sense only in reference *comctl32.dll* (in case no direct imported any other api from it or direct load). about `InitCommonControlsEx` - read [`RegisterClassNameW`](https://www.geoffchappell.com/studies/windows/shell/comctl32/api/commctrl/registerclassnamew.htm) and [`InitCommonControlsEx`](https://www.geoffchappell.com/studies/windows/shell/comctl32/api/commctrl/initcommoncontrolsex.htm) - so you not need call this api too – RbMm Jun 29 '23 at 08:07
  • [InitCommonControlsEx](https://learn.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-initcommoncontrolsex) Ensures that the common control DLL (Comctl32.dll) is loaded, and registers specific common control classes from the DLL. If they are not used, It's unnecessary to call `InitCommonControlsEx`. – YangXiaoPo-MSFT Jul 04 '23 at 08:42

0 Answers0