- Keep track of all system colors used by comctl32.dll.
- Provide routine to support the WM_SYSCOLORCHANGE message.
This commit is contained in:
parent
71e4b98f5a
commit
35d8e1ec0a
|
@ -93,9 +93,31 @@ extern HBRUSH COMCTL32_hPattern55AABrush;
|
|||
/* DragList icon */
|
||||
#define IDI_DRAGARROW 150
|
||||
|
||||
typedef struct
|
||||
{
|
||||
COLORREF clrBtnHighlight; /* COLOR_BTNHIGHLIGHT */
|
||||
COLORREF clrBtnShadow; /* COLOR_BTNSHADOW */
|
||||
COLORREF clrBtnText; /* COLOR_BTNTEXT */
|
||||
COLORREF clrBtnFace; /* COLOR_BTNFACE */
|
||||
COLORREF clrHighlight; /* COLOR_HIGHLIGHT */
|
||||
COLORREF clrHighlightText; /* COLOR_HIGHLIGHTTEXT */
|
||||
COLORREF clr3dHilight; /* COLOR_3DHILIGHT */
|
||||
COLORREF clr3dShadow; /* COLOR_3DSHADOW */
|
||||
COLORREF clr3dDkShadow; /* COLOR_3DDKSHADOW */
|
||||
COLORREF clr3dFace; /* COLOR_3DFACE */
|
||||
COLORREF clrWindow; /* COLOR_WINDOW */
|
||||
COLORREF clrWindowText; /* COLOR_WINDOWTEXT */
|
||||
COLORREF clrGrayText; /* COLOR_GREYTEXT */
|
||||
COLORREF clrActiveCaption; /* COLOR_ACTIVECAPTION */
|
||||
COLORREF clrInfoBk; /* COLOR_INFOBK */
|
||||
COLORREF clrInfoText; /* COLOR_INFOTEXT */
|
||||
} COMCTL32_SysColor;
|
||||
|
||||
extern COMCTL32_SysColor comctl32_color;
|
||||
|
||||
/* Internal function */
|
||||
HWND COMCTL32_CreateToolTip (HWND);
|
||||
VOID COMCTL32_RefreshSysColors(void);
|
||||
INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen);
|
||||
BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc);
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ LPSTR COMCTL32_aSubclass = (LPSTR)NULL;
|
|||
HMODULE COMCTL32_hModule = 0;
|
||||
LANGID COMCTL32_uiLang = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL);
|
||||
HBRUSH COMCTL32_hPattern55AABrush = (HANDLE)NULL;
|
||||
COMCTL32_SysColor comctl32_color;
|
||||
|
||||
static HBITMAP COMCTL32_hPattern55AABitmap = (HANDLE)NULL;
|
||||
|
||||
|
@ -124,6 +125,9 @@ COMCTL32_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
COMCTL32_hPattern55AABitmap = CreateBitmap (8, 8, 1, 1, wPattern55AA);
|
||||
COMCTL32_hPattern55AABrush = CreatePatternBrush (COMCTL32_hPattern55AABitmap);
|
||||
|
||||
/* Get all the colors at DLL load */
|
||||
COMCTL32_RefreshSysColors();
|
||||
|
||||
/* register all Win95 common control classes */
|
||||
ANIMATE_Register ();
|
||||
FLATSB_Register ();
|
||||
|
@ -1027,3 +1031,37 @@ COMCTL32_CreateToolTip(HWND hwndOwner)
|
|||
|
||||
return hwndToolTip;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* COMCTL32_RefreshSysColors [NOT AN API]
|
||||
*
|
||||
* Invoked on any control recognizing a WM_SYSCOLORCHANGE message to
|
||||
* refresh the color values in the color structure
|
||||
*
|
||||
* PARAMS
|
||||
* none
|
||||
*
|
||||
* RETURNS
|
||||
* none
|
||||
*/
|
||||
VOID
|
||||
COMCTL32_RefreshSysColors(void)
|
||||
{
|
||||
comctl32_color.clrBtnHighlight = GetSysColor (COLOR_BTNHIGHLIGHT);
|
||||
comctl32_color.clrBtnShadow = GetSysColor (COLOR_BTNSHADOW);
|
||||
comctl32_color.clrBtnText = GetSysColor (COLOR_BTNTEXT);
|
||||
comctl32_color.clrBtnFace = GetSysColor (COLOR_BTNFACE);
|
||||
comctl32_color.clrHighlight = GetSysColor (COLOR_HIGHLIGHT);
|
||||
comctl32_color.clrHighlightText = GetSysColor (COLOR_HIGHLIGHTTEXT);
|
||||
comctl32_color.clr3dHilight = GetSysColor (COLOR_3DHILIGHT);
|
||||
comctl32_color.clr3dShadow = GetSysColor (COLOR_3DSHADOW);
|
||||
comctl32_color.clr3dDkShadow = GetSysColor (COLOR_3DDKSHADOW);
|
||||
comctl32_color.clr3dFace = GetSysColor (COLOR_3DFACE);
|
||||
comctl32_color.clrWindow = GetSysColor (COLOR_WINDOW);
|
||||
comctl32_color.clrWindowText = GetSysColor (COLOR_WINDOWTEXT);
|
||||
comctl32_color.clrGrayText = GetSysColor (COLOR_GRAYTEXT);
|
||||
comctl32_color.clrActiveCaption = GetSysColor (COLOR_ACTIVECAPTION);
|
||||
comctl32_color.clrInfoBk = GetSysColor (COLOR_INFOBK);
|
||||
comctl32_color.clrInfoText = GetSysColor (COLOR_INFOTEXT);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue