You may not want to look at GetSysColor/SetSysColors, as this would apply a global effect. But try the following (you'll need aform with a menu on it, obviously...): [tt]
Option Explicit
Private Declare Function CreateBrushIndirect Lib "gdi32" (lpLogBrush As LOGBRUSH) As Long
Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetMenuInfo Lib "user32" (ByVal hMenu As Long, lpcmi As tagMENUINFO) As Long
Private Declare Function SetMenuInfo Lib "user32" (ByVal hMenu As Long, lpcmi As tagMENUINFO) As Long
Private Type LOGBRUSH
lbStyle As Long
lbColor As Long
lbHatch As Long
End Type
Private Type tagMENUINFO
cbSize As Long
fMask As Long
dwStyle As Long
cyMax As Long
hbrBack As Long
dwContextHelpID As Long
dwMenuData As Long
End Type
miMenuInfo.cbSize = Len(miMenuInfo)
ret = GetMenuInfo(hMenu, miMenuInfo) ' 0 means failure
miMenuInfo.fMask = MIM_BACKGROUND 'MIM_APPLYTOSUBMENUS use this to apply to submenus as well
miMenuInfo.hbrBack = hBrush
ret = SetMenuInfo(hMenu, miMenuInfo) '0 means failure
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.