Author Topic: Popup Menu  (Read 4388 times)

clamicun

  • Member
  • ***
  • Posts: 347
Re: Popup Menu
« Reply #60 on: April 23, 2019, 08:10:35 PM »
Biterider,
ok.
Pity, I hoped it would be source

jj2007

  • Member
  • *****
  • Posts: 10086
  • Assembler is fun ;-)
    • MasmBasic
Re: Popup Menu
« Reply #61 on: April 23, 2019, 08:49:28 PM »
what is this ?

Probably what you were looking for :biggrin:

Attention, it might not work with Aero themes on.

clamicun

  • Member
  • ***
  • Posts: 347
Re: Popup Menu
« Reply #62 on: April 23, 2019, 09:18:01 PM »
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

  • Member
  • *****
  • Posts: 1243
  • <AMD>< 7-32>
Re: Popup Menu
« Reply #63 on: April 23, 2019, 09:25:34 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:

Biterider

  • Member
  • ***
  • Posts: 459
  • ObjAsm32 + ObjAsm64 = ObjAsm
    • ObjAsm
Re: Popup Menu
« Reply #64 on: April 23, 2019, 10:21:41 PM »
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!

AW

  • Member
  • *****
  • Posts: 2563
  • Let's Make ASM Great Again!
Re: Popup Menu
« Reply #65 on: April 24, 2019, 01:59:29 AM »
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

  • Member
  • ***
  • Posts: 347
Re: Popup Menu
« Reply #66 on: April 24, 2019, 04:10:23 AM »
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

AW

  • Member
  • *****
  • Posts: 2563
  • Let's Make ASM Great Again!
Re: Popup Menu
« Reply #67 on: April 24, 2019, 04:54:13 AM »
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

  • Member
  • *****
  • Posts: 10086
  • Assembler is fun ;-)
    • MasmBasic
Re: Popup Menu
« Reply #68 on: April 24, 2019, 08:26:16 PM »
Work in progress ;-)

SetToolbarColour RgbCol(200, 255, 200)

clamicun

  • Member
  • ***
  • Posts: 347
Re: Popup Menu
« Reply #69 on: April 26, 2019, 08:12:45 PM »
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

  • Member
  • ***
  • Posts: 494
Re: Popup Menu
« Reply #70 on: April 26, 2019, 09:02:24 PM »
You might want to use that techique for menu with bitmaps ;)
A C example using that.
May the source be with you

AW

  • Member
  • *****
  • Posts: 2563
  • Let's Make ASM Great Again!
Re: Popup Menu
« Reply #71 on: April 26, 2019, 09:45:02 PM »
With Menubar OwnerDrawn is the way to go.
But best is Toolbar with or without dockbar.


felipe

  • Member
  • *****
  • Posts: 1265
  • Eagles are just great!
Re: Popup Menu
« Reply #72 on: April 26, 2019, 10:58:11 PM »
that's nice  :icon14:
Felipe.