ReactOS 0.4.15-dev-5664-g3bf4ef6
comctl32supp.h File Reference
#include <windowsx.h>
Include dependency graph for comctl32supp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define Button_IsEnabled(hwndCtl)   IsWindowEnabled((hwndCtl))
 
#define UM_CHECKSTATECHANGE   (WM_USER + 100)
 

Functions

HRESULT GetComCtl32Version (OUT PDWORD pdwMajor, OUT PDWORD pdwMinor, OUT PDWORD pdwBuild)
 

Macro Definition Documentation

◆ Button_IsEnabled

#define Button_IsEnabled (   hwndCtl)    IsWindowEnabled((hwndCtl))

Definition at line 14 of file comctl32supp.h.

◆ UM_CHECKSTATECHANGE

#define UM_CHECKSTATECHANGE   (WM_USER + 100)

Definition at line 16 of file comctl32supp.h.

Function Documentation

◆ GetComCtl32Version()

HRESULT GetComCtl32Version ( OUT PDWORD  pdwMajor,
OUT PDWORD  pdwMinor,
OUT PDWORD  pdwBuild 
)

Definition at line 11 of file comctl32supp.c.

12{
13 HRESULT hr = S_OK;
14 HINSTANCE hDll;
15 DLLGETVERSIONPROC pDllGetVersion;
17
18 *pdwMajor = 0;
19 *pdwMinor = 0;
20 *pdwBuild = 0;
21
22 /*
23 * WARNING! DISCLAIMER!
24 *
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.
28 */
29
30 /*
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.
34 */
35
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;
39
40 pDllGetVersion = (DLLGETVERSIONPROC)GetProcAddress(hDll, "DllGetVersion");
41 if (pDllGetVersion)
42 {
43 ZeroMemory(&dvi, sizeof(dvi));
44 dvi.cbSize = sizeof(dvi);
45
46 hr = (*pDllGetVersion)(&dvi);
47 if (SUCCEEDED(hr))
48 {
49 *pdwMajor = dvi.dwMajorVersion;
50 *pdwMinor = dvi.dwMinorVersion;
51 *pdwBuild = dvi.dwBuildNumber;
52
53#if 0
54// #include "stringutils.h"
55
56 LPWSTR strVersion =
57 FormatString(L"ComCtl32 version %d.%d, Build %d, Platform %d",
59 MessageBoxW(NULL, strVersion, L"ComCtl32 version", MB_OK);
60 MemFree(strVersion);
61#endif
62 }
63 }
64 else
65 {
66 /*
67 * If GetProcAddress failed, the DLL is a version
68 * previous to the one shipped with IE 3.x.
69 */
70 *pdwMajor = 4;
71 *pdwMinor = 0;
72 *pdwBuild = 0;
73 }
74
75 return hr;
76}
BOOL MemFree(IN PVOID lpMem)
Definition: utils.c:26
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
DWORD FormatString(DWORD dwFlags, HINSTANCE hInstance, DWORD dwStringId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, va_list *Arguments)
Definition: fontview.c:49
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define L(x)
Definition: ntvdm.h:50
HRESULT hr
Definition: shlfolder.c:183
HRESULT(CALLBACK * DLLGETVERSIONPROC)(DLLVERSIONINFO *)
Definition: shlwapi.h:1964
DWORD dwMajorVersion
Definition: shlwapi.h:1955
DWORD dwBuildNumber
Definition: shlwapi.h:1957
DWORD dwMinorVersion
Definition: shlwapi.h:1956
DWORD dwPlatformID
Definition: shlwapi.h:1958
#define ZeroMemory
Definition: winbase.h:1670
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_OK
Definition: winuser.h:784
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by TreeView_Set3StateCheck().