IonicWind Software

IWBasic => GUI Central => Topic started by: Bruce Peaslee on August 30, 2010, 11:07:03 AM

Title: Set Menu Color
Post by: Bruce Peaslee on August 30, 2010, 11:07:03 AM
I like my windows and dialogs to be just a little darker shade of gray than standard. This causes the menu bar to stand out. Here is a little routine to change the menu color to match (or not) that of the window.

'ÂÃ,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯Ã‚Ã,¯
Sub SetMenuColor(int hWnd, int dwColor, int bIncludeSubmenus)
'_________________________________________________________________________________________________________________



MENUINFO mi
int flags

flags  = MIM_BACKGROUND

if bIncludeSubmenus
flags = flags | MIM_APPLYTOSUBMENUS
endif

mi.cbSize = len(mi)
mi.fmask = flags
mi.hbrBack = CreateSolidBrush(dwColor)

SetMenuInfo(GetMenu(hWnd), mi)

DrawMenuBar(hWnd)

EndSub

'Usage

SetMenuColor(wMain, RGB(175,175,175), true)

Title: Re: Set Menu Color
Post by: Guilect on August 30, 2010, 05:33:25 PM
Thanks for sharing.
This goes into the snippets bucket until such time it gets used.   :)
Title: Re: Set Menu Color
Post by: jerryclement on August 31, 2010, 02:25:00 AM
QuoteThanks for sharing.
This goes into the snippets bucket until such time it gets used.   

Thanks Peaslee,
Jerry C