Common Control Versions
This topic lists the available versions of the Common Control library (ComCtl32.dll), describes how to identify the version that your application is using, and explains how to target your application for a specific version.
This topic contains the following sections.
Common Control DLL Versions Numbers
Support for common controls is provided by ComCtl32.dll, which all 32-bit and 64-bit versions of Windows include. Each successive version of the DLL supports the features and API of earlier versions and adds new features.
Because various versions of ComCtl32.dll were distributed with Internet Explorer, the version that is active is sometimes different from the version that was shipped with the operating system. Therefore, your application must directly determine which version of ComCtl32.dll is present.
In the common controls reference documentation, many programming elements specify a minimum supported DLL version number. This version number indicates that the programming element is implemented in that version and subsequent versions of the DLL unless otherwise specified. If no version number is specified, the programming element is implemented in all existing versions of the DLL.
The following table outlines the different DLL versions and how they were distributed on supported OSes.
Microsoft Internet ExplorerВ 5.01, Microsoft Internet ExplorerВ 5.5, and Microsoft Internet ExplorerВ 6
Windows ServerВ 2003, WindowsВ Vista, Windows ServerВ 2008, and WindowsВ 7
Windows ServerВ 2003
WindowsВ Vista, Windows ServerВ 2008, and WindowsВ 7
Structure Sizes for Different Common Control Versions
Ongoing enhancements to common controls have resulted in the need to extend many of the structures. For this reason, the size of the structures has changed between different versions of Commctrl.h. Because most of the common control structures take a structure size as one of the parameters, a message or function can fail if the size is not recognized. To remedy this, structure size constants have been defined to aid in targeting different version of ComCtl32.dll. The following list defines the structure size constants.
HDITEM_V1_SIZE | The size of the HDITEM structure in version 4.0. |
IMAGELISTDRAWPARAMS_V3_SIZE | The size of the IMAGELISTDRAWPARAMS structure in version 5.9. |
LVCOLUMN_V1_SIZE | The size of the LVCOLUMN structure in version 4.0. |
LVGROUP_V5_SIZE | The size of the LVGROUP structure in version 6.0. |
LVHITTESTINFO_V1_SIZE | The size of the LVHITTESTINFO structure in version 4.0. |
LVITEM_V1_SIZE | The size of the LVITEM structure in version 4.0. |
LVITEM_V5_SIZE | The size of the LVITEM structure in version 6.0. |
LVTILEINFO_V5_SIZE | The size of the LVTILEINFO structure in version 6.0. |
MCHITTESTINFO_V1_SIZE | The size of the MCHITTESTINFO structure in version 4.0. |
NMLVCUSTOMDRAW_V3_SIZE | The size of the NMLVCUSTOMDRAW structure in version 4.7. |
NMTTDISPINFO_V1_SIZE | The size of the NMTTDISPINFO structure in version 4.0. |
NMTVCUSTOMDRAW_V3_SIZE | The size of the NMTVCUSTOMDRAW structure in version 4.7. |
PROPSHEETHEADER_V1_SIZE | The size of the PROPSHEETHEADER structure in version 4.0. |
PROPSHEETPAGE_V1_SIZE | The size of the PROPSHEETPAGE structure in version 4.0. |
REBARBANDINFO_V3_SIZE | The size of the REBARBANDINFO structure in version 4.7. |
REBARBANDINFO_V6_SIZE | The size of the REBARBANDINFO structure in version 6.0. |
TTTOOLINFO_V1_SIZE | The size of the TOOLINFO structure in version 4.0. |
TTTOOLINFO_V2_SIZE | The size of the TOOLINFO structure in version 4.7. |
TTTOOLINFO_V3_SIZE | The size of the TOOLINFO structure in version 6.0. |
TVINSERTSTRUCT_V1_SIZE | The size of the TVINSERTSTRUCT structure in version 4.0. |
Using DllGetVersion to Determine the Version Number
The DllGetVersion function can be called by an application to determine which DLL version is present on the system.
DllGetVersion returns a DLLVERSIONINFO2 structure. In addition to the information provided through DLLVERSIONINFO, DLLVERSIONINFO2 also provides the hotfix number that identifies the latest installed service pack, which provides a more robust way to compare version numbers. Because the first member of DLLVERSIONINFO2 is a DLLVERSIONINFO structure, the later structure is backward-compatible.
The following sample function GetVersion loads a specified DLL and attempts to call its DllGetVersion function. If successful, it uses a macro to pack the major and minor version numbers from the DLLVERSIONINFO structure into a DWORD that is returned to the calling application. If the DLL does not export DllGetVersion, the function returns zero. You can modify the function to handle the possibility that DllGetVersion returns a DLLVERSIONINFO2 structure. If so, use the information in that DLLVERSIONINFO2 structure’s ullVersion member to compare versions, build numbers, and service pack releases. The MAKEDLLVERULL macro simplifies the task of comparing these values to those in ullVersion.
Using LoadLibrary incorrectly can pose security risks. Refer to the LoadLibrary documentation for information on how to correctly load DLLs with different versions of Windows.
The following code example shows how you can use GetVersion to test whether ComCtl32.dll is version 6.0 or later.
Project Versions
To ensure that your application is compatible with different targeted versions of a .dll file, version macros are present in the header files. These macros are used to define, exclude, or redefine certain definitions for different versions of the DLL. See Using the Windows Headers for an in-depth description of these macros.
For example, the macro name _WIN32_IE is commonly found in older headers. You are responsible for defining the macro as a hexadecimal number. This version number defines the target version of the application that is using the DLL. The following table shows the available version numbers and the effect each has on your application.
Version | Description |
---|---|
0x0300 | The application is compatible with ComCtl32.dll version 4.70 and later. The application cannot implement features that were added after version 4.70. |
0x0400 | The application is compatible with ComCtl32.dll version 4.71 and later. The application cannot implement features that were added after version 4.71. |
0x0401 | The application is compatible with ComCtl32.dll version 4.72 and later. The application cannot implement features that were added after version 4.72. |
0x0500 | The application is compatible with ComCtl32.dll version 5.80 and later. The application cannot implement features that were added after version 5.80. |
0x0501 | The application is compatible with ComCtl32.dll version 5.81 and later. The application cannot implement features that were added after version 5.81. |
0x0600 | The application is compatible with ComCtl32.dll version 6.0 and later. The application cannot implement features that were added after version 6.0. |
If you do not define the _WIN32_IE macro in your project, it is automatically defined as 0x0500. To define a different value, you can add the following to the compiler directives in your make file; substitute the desired version number for 0x0400.
Another method is to add a line similar to the following in your source code before you include the Shell header files. Substitute the desired version number for 0x0400.
Windows common control version
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
I’m looking to add the Microsoft Time and Date Picker Control in Excel 2016, as was possible in earlier versions. In Office 2013, you had to download and register the Microsoft Windows Common Controls 6.0 (SP6) to access this feature, but now I can’t find it anywhere. Several places have links to it that all seem to be broken.
Any suggestions as to where to find these controls, or is there an alternative way to add a pop-up calendar to a cell in Excel?
Answers
You can download Microsoft Windows Common Controls 6.0 from this link:
But the requirement didn’t tell us if Office 2016 can use it.
You may need to try to do a experiment.
Emi Zhang
TechNet Community Support
Please mark the reply as an answer if you find it is helpful.
If you have feedback for TechNet Support, contact tnmff@microsoft.com.
- Marked as answer by Emi Zhang Microsoft contingent staff Tuesday, April 26, 2016 9:50 AM
All replies
You can download Microsoft Windows Common Controls 6.0 from this link:
But the requirement didn’t tell us if Office 2016 can use it.
You may need to try to do a experiment.
Emi Zhang
TechNet Community Support
Please mark the reply as an answer if you find it is helpful.
If you have feedback for TechNet Support, contact tnmff@microsoft.com.
- Marked as answer by Emi Zhang Microsoft contingent staff Tuesday, April 26, 2016 9:50 AM
The below worked for me on 64 bit windows 8.1. I am using office 365.
- Download VisualBasic6-KB896559-v1-ENU.exe from https://www.microsoft.com/en-us/download/details.aspx?id=10019
- Use 7-zip and extract the file MSCOMCTL.OCX to c:\windows\system32
- Open cmd as administrator
- Type Regsvr32 «C:\Windows\System32\MSCOMCTL.OCX»
- Download VisualBasic6-KB896559-v1-ENU.exe from https://www.microsoft.com/en-us/download/details.aspx?id=10019
- Use 7-zip and extract the file MSCOMCTL.OCX to c:\windows\SYSWOW64
- Open cmd as administrator
- Type Regsvr32 «C:\Windows\Syswow64\MSCOMCTL.OCX»
Microsoft Reference document:
This does not work for Office 2016 or any of the 365 versions.
The below worked for me on 64 bit windows 8.1. I am using office 365.
- Download VisualBasic6-KB896559-v1-ENU.exe from https://www.microsoft.com/en-us/download/details.aspx?id=10019
- Use 7-zip and extract the file MSCOMCTL.OCX to c:\windows\system32
- Open cmd as administrator
- Type Regsvr32 «C:\Windows\System32\MSCOMCTL.OCX»
- Download VisualBasic6-KB896559-v1-ENU.exe from https://www.microsoft.com/en-us/download/details.aspx?id=10019
- Use 7-zip and extract the file MSCOMCTL.OCX to c:\windows\SYSWOW64
- Open cmd as administrator
- Type Regsvr32 «C:\Windows\Syswow64\MSCOMCTL.OCX»
Microsoft Reference document:
Thank you very much! This worked for me with the following configuration:
office 2016, Win 7 64 Bit
Additionally I copied the file in system32 directory, then it worked correct.
I got the failure by transmitting the document from office 2010 to 2016.
Common Control Styles
This section lists common control styles. Except where noted, these styles apply to rebar controls, toolbar controls, and status windows.
Constant | Description |
---|---|
CCS_ADJUSTABLE | Enables a toolbar’s built-in customization features, which let the user to drag a button to a new position or to remove a button by dragging it off the toolbar. In addition, the user can double-click the toolbar to display the Customize Toolbar dialog box, which enables the user to add, delete, and rearrange toolbar buttons. |
CCS_BOTTOM | Causes the control to position itself at the bottom of the parent window’s client area and sets the width to be the same as the parent window’s width. Status windows have this style by default. |
CCS_LEFT | Version 4.70. Causes the control to be displayed vertically on the left side of the parent window. |
CCS_NODIVIDER | Prevents a two-pixel highlight from being drawn at the top of the control. |
CCS_NOMOVEX | Version 4.70. Causes the control to resize and move itself vertically, but not horizontally, in response to a WM_SIZE message. If CCS_NORESIZE is used, this style does not apply. |
CCS_NOMOVEY | Causes the control to resize and move itself horizontally, but not vertically, in response to a WM_SIZE message. If CCS_NORESIZE is used, this style does not apply. Header windows have this style by default. |
CCS_NOPARENTALIGN | Prevents the control from automatically moving to the top or bottom of the parent window. Instead, the control keeps its position within the parent window despite changes to the size of the parent. If CCS_TOP or CCS_BOTTOM is also used, the height is adjusted to the default, but the position and width remain unchanged. |
CCS_NORESIZE | Prevents the control from using the default width and height when setting its initial size or a new size. Instead, the control uses the width and height specified in the request for creation or sizing. |
CCS_RIGHT | Version 4.70. Causes the control to be displayed vertically on the right side of the parent window. |
CCS_TOP | Causes the control to position itself at the top of the parent window’s client area and sets the width to be the same as the parent window’s width. Toolbars have this style by default. |
CCS_VERT | Version 4.70. Causes the control to be displayed vertically. |
Remarks
The following topics describe additional control styles: