| Author | Topic: Change the Menubar via Win-API |
---|
| Itai Ben-Artzi | Change the Menubar via Win-API
on Thu, 25 May 2023 01:50:31 -0700Is it possible to programmatically change the menubar font and color
via the Win-API?
How?
Many thanks,
-Itai |
| Jim Lee | Re: Change the Menubar via Win-API
on Tue, 06 Jun 2023 22:59:58 +0200hi,
> Is it possible to programmatically change the menubar font and color
> via the Win-API?
Xbase++ have a Ownerdraw Menu Sample
c:\ALASKA\XPPW32\Source\samples\basics\OWNERDRW\ |
| Itai Ben-Artzi | Re: Change the Menubar via Win-API
on Tue, 06 Jun 2023 14:52:49 -0700Jim,
The Ownerdraw does not affect the main menu-bar items, it is only good
for the sub-menu-items. |
| Jim Lee | Re: Change the Menubar via Win-API
on Sat, 17 Jun 2023 03:30:24 +0200 |
| Carlos Beling | Re: Change the Menubar via Win-API
on Mon, 19 Jun 2023 11:54:40 -0300Hi Jim. Good morning.
Can you posting here how did you made this?
Fraternally
Beling
Em 16/06/2023 22:30, Jim Lee escreveu:
> > The Ownerdraw does not affect the main menu-bar items, it is only good
> > for the sub-menu-items. |
| Itai Ben-Artzi | Re: Change the Menubar via Win-API
on Fri, 14 Jul 2023 11:12:34 -0700Jim,
Can we change the font of the menu-bar {above the shortcut-images)? |
| Jim Lee | Re: Change the Menubar via Win-API
on Tue, 08 Aug 2023 05:39:39 +0200hi,
i have to say sorry about last Picture as i use harbour / HMG***, not
Xbase++, for it
***https://www.hmgforum.com/app.php/download
SetMenuBkGradient(hWnd, lSubMenu, RGB1, RGB2, nDirection, Wide, Height)
HB_FUNC( SETMENUBKGRADIENT )
{
HMENU iMenu ;
MENUINFO iMenuInfo ;
HBRUSH hBrush ;
HWND hWnd = (HWND) HMG_parnl (1);
BOOL lSubMenu = (BOOL) hb_parl (2);
INT nWide = (INT) hb_parnl (6);
INT nHeight = (INT) hb_parnl (7);
hBrush = CreateSolidBrush( RGB( hb_parvni( 3, 1 ), hb_parvni( 3, 2 ),
hb_parvni( 3, 3 ) ) );
iMenu = GetMenu ( hWnd );
GetMenuInfo(iMenu, &iMenuInfo);
iMenuInfo.cbSize = sizeof(MENUINFO);
if (lSubMenu)
iMenuInfo.fMask = MIM_BACKGROUND | MIM_APPLYTOSUBMENUS;
else
iMenuInfo.fMask = MIM_BACKGROUND;
iMenuInfo.hbrBack = hBrush ;
SetMenuInfo(iMenu, &iMenuInfo);
DrawMenuBar( (HWND) HMG_parnl (1) );
}
---
what you can do is set
oDlg:titleBar := .F.
and add a XbpStatic to "simulate" Titlebar |
| Slavoljub Damnjanovic | Re: Change the Menubar via Win-API
on Mon, 02 Oct 2023 10:26:51 +0200>The Ownerdraw does not affect the main menu-bar items, it is only good
>for the sub-menu-items.
The XbpMenuBar owner-draw does affect the main menu-bar items. You can set the
width of items, font of items and colors for normal, selected and disabled
items. You can also display caption and image for each item.
Regards |