News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Popup Menu

Started by clamicun, April 09, 2019, 12:16:59 AM

Previous topic - Next topic

clamicun

Biterider,
ok.
Pity, I hoped it would be source

jj2007

Quote from: clamicun on April 23, 2019, 07:05:59 PM
what is this ?

Probably what you were looking for :biggrin:

Attention, it might not work with Aero themes on.

clamicun

sUXT db "C:\windows\system32\UxTheme.dll",0
sFunc db "SetWindowTheme",0
swNull dw 0

.code
start:
   INVOKE LoadLibrary, ADDR sUXT
   .if eax
      INVOKE GetProcAddress, eax, ADDR sFunc
      .if eax
         push OFFSET swNull
         push OFFSET swNull
         call eax
      .endif
   .endif

TimoVJL,
Unfortunately not.
The dropdownmenu is colored, but not the menubar



HSE

Quote from: jj2007 on April 23, 2019, 08:49:28 PM
Attention, it might not work with Aero themes on.

Disabling "visual themes" in properties of .exe file you obtain a classic window with Aero theme around!

@Clamicum:
   This is exactly your second .exe file:
Equations in Assembly: SmplMath

Biterider

Hi clamicun
I send you the most important files with which you can look into the MenuBar functionality.
XMenu is the most important file. In particular, look into FlashMenuBar method.

Regards, Biterider

PS: the source code is 32/64 bit!

aw27

This is a colored menubar with a hatched background. No need for themes.
It is easy to do, so I believe you are talking about something different.

clamicun

AW,
thats exactly what I am talking about but on my 2 computers (win7 and win 10) it doesn't work with SetMenuInfo.  (MIM_BACKGROUND + MIM_APPLYTOSUBMENUS).
Only the dropdownmenu (in your picture "Exit" gets colored

aw27

No themes means: it works in Windows 2000 as well.


In summary:
1) In WM_CREATE you make the background with SetMenuInfo and mask MIM_BACKGROUND (no  MIM_APPLYTOSUBMENUS)
2) In WM_MEASUREITEM you define the itemWidth and itemHeight in the MEASUREITEMSTRUCT passed in the LPARAM
3) In WM_DRAWITEM you have the DRAWITEMSTRUCT passed in the LPARAM. From it you know what is the rectangle to paint.

jj2007

Work in progress ;-)

SetToolbarColour RgbCol(200, 255, 200)

clamicun

AW,

In summary:
1) In WM_CREATE you make the background with SetMenuInfo and mask MIM_BACKGROUND (no  MIM_APPLYTOSUBMENUS)
2) In WM_MEASUREITEM you define the itemWidth and itemHeight in the MEASUREITEMSTRUCT passed in the LPARAM
3) In WM_DRAWITEM you have the DRAWITEMSTRUCT passed in the LPARAM. From it you know what is the rectangle to paint.

This refers to userdrawn menus. Works with others too? My example is not userdrawn

TimoVJL

You might want to use that techique for menu with bitmaps ;)
A C example using that.
May the source be with you

aw27

With Menubar OwnerDrawn is the way to go.
But best is Toolbar with or without dockbar.


felipe

that's nice  :icon14: