2 * PROJECT: ReactOS Applications
3 * LICENSE: LGPL - See COPYING in the top level directory
4 * FILE: base/applications/msconfig_new/comctl32ex/comctl32supp.c
5 * PURPOSE: Common Controls helper functions.
6 * COPYRIGHT: Copyright 2011-2012 Hermes BELUSCA - MAITO <hermes.belusca@sfr.fr>
11 HRESULT
GetComCtl32Version(OUT PDWORD pdwMajor
, OUT PDWORD pdwMinor
, OUT PDWORD pdwBuild
)
15 DLLGETVERSIONPROC pDllGetVersion
;
23 * WARNING! DISCLAIMER!
25 * This method of retrieving a handle to an already loaded comctl32.dll
26 * is known to not be reliable in case the program is using SxS, or if
27 * this code is used from inside a DLL.
31 * See: https://msdn.microsoft.com/en-us/library/windows/desktop/hh298349(v=vs.85).aspx
32 * and: http://www.geoffchappell.com/studies/windows/shell/comctl32/history/
33 * for the possible version values to be returned.
36 /* Get a handle to comctl32.dll that must already be loaded */
37 hDll
= GetModuleHandleW(L
"comctl32.dll"); // NOTE: We must not call FreeLibrary on the returned handle!
38 if (!hDll
) return E_FAIL
;
40 pDllGetVersion
= (DLLGETVERSIONPROC
)GetProcAddress(hDll
, "DllGetVersion");
43 ZeroMemory(&dvi
, sizeof(dvi
));
44 dvi
.cbSize
= sizeof(dvi
);
46 hr
= (*pDllGetVersion
)(&dvi
);
49 *pdwMajor
= dvi
.dwMajorVersion
;
50 *pdwMinor
= dvi
.dwMinorVersion
;
51 *pdwBuild
= dvi
.dwBuildNumber
;
54 // #include "stringutils.h"
57 FormatString(L
"ComCtl32 version %d.%d, Build %d, Platform %d",
58 dvi
.dwMajorVersion
, dvi
.dwMinorVersion
, dvi
.dwBuildNumber
, dvi
.dwPlatformID
);
59 MessageBoxW(NULL
, strVersion
, L
"ComCtl32 version", MB_OK
);
67 * If GetProcAddress failed, the DLL is a version
68 * previous to the one shipped with IE 3.x.