Author Topic: Popup Menu  (Read 1693 times)

clamicun

  • Member
  • ***
  • Posts: 335
Re: Popup Menu
« Reply #15 on: April 14, 2019, 06:28:52 AM »
AW,
thanks. Had the same (similar) ideia.

_MENUBARINFO STRUCT
   cbSize                 DWORD ?
   rcBar                  RECT <>
   hMenu                DWORD ?
   hwndMenu           DWORD ?
   fBarFocused         WORD ?
   fFocused              WORD ?
_MENUBARINFO ENDS

At least GetMenuBarInfo returns 1

clamicun

  • Member
  • ***
  • Posts: 335
Re: Popup Menu
« Reply #16 on: April 15, 2019, 11:45:39 PM »
AW,
yes, your structure seems to work.
But I do not understand the values returned by rcBar

mbar.rcBar.left"
mbar.rcBar.right
...
...
They definitely dont correspond to my menu, created with CreateMenu

invoke GetMenuBarInfo.hwnd
MS says: "A handle to the window (menu bar) whose information is to be retrieved."

That is the handle of the mainwindow which contains the menu or to the menubar ?

AW

  • Member
  • *****
  • Posts: 2028
  • Let's Make ASM Great Again!
Re: Popup Menu
« Reply #17 on: April 16, 2019, 02:05:14 AM »
I understand your code is secret and you can't publish it but I have no idea what you are doing.

clamicun

  • Member
  • ***
  • Posts: 335
Re: Popup Menu
« Reply #18 on: April 16, 2019, 03:51:01 AM »
AW,
???
Why my code is secret ?

I wrote this a couple of times by now:

invoke GetMenuBarInfo,handle_win, OBJID_MENU,0,addr -mbi
(Last time I asked this: handle_win is the handle of the mainwindow of the application or ?)

I check the values
_mbi.rcBar.right
_mbi.rcBar.bottom

Weird values.

They very likely should be:
right = mainwindow width
bottom = ca. 25p (menubar with text)

AW

  • Member
  • *****
  • Posts: 2028
  • Let's Make ASM Great Again!
Re: Popup Menu
« Reply #19 on: April 16, 2019, 04:27:58 AM »
If the function returns false then  use GetLastError to know the exact reason for the error.   ;)

clamicun

  • Member
  • ***
  • Posts: 335
Re: Popup Menu
« Reply #20 on: April 16, 2019, 04:41:28 AM »
AW,
???
I wrote that already. With your modified structure the function GetMenuBarInfo returns 1.
I am talking about the values of _mbi.rcBar.

AW

  • Member
  • *****
  • Posts: 2028
  • Let's Make ASM Great Again!
Re: Popup Menu
« Reply #21 on: April 16, 2019, 05:29:01 AM »
If you don't show your code, all I can do is wish you a good luck, you may even find the bug by yourself.  :t

clamicun

  • Member
  • ***
  • Posts: 335
Re: Popup Menu
« Reply #22 on: April 16, 2019, 07:41:01 AM »
Thank you very much. You're really stubborn ... show code ... it's a normal window ... In WM_CREATE  I create a menu and popupmenu. Everything is business as usual and works fine ... What would you like to see ? ... I am just trying to get all sorts of info about the menubar, cause I would like to change the color of it. Right now it's "GetMenuBarInfo" I am playing with and simply do not understand the values of _mbi.rcBar. right, bottom, left  ... btw. the code is in my  file.zip
« Last Edit: April 16, 2019, 06:57:30 PM by clamicun »

clamicun

  • Member
  • ***
  • Posts: 335
Re: Popup Menu
« Reply #23 on: April 17, 2019, 05:23:13 AM »
By now I read about 15 articles on GetMenuBarInfo.
I swear noone mentioned that the values returned by mbi.rcBar. ...
correspond to screendimensions.

HSE

  • Member
  • *****
  • Posts: 1010
  • <AMD>< 7-32>
Re: Popup Menu
« Reply #24 on: April 17, 2019, 09:31:19 AM »
Clamicum:

You have not posted files using structure.

Sometimes I forgot to make (before to getinfo):
Code: [Select]
mov mbi.cbsize, sizeof _MENUBARINFO
In the 15 articles have to say: A handle to the menu bar whose information is to be retrieved!  (ebx in MinWin)

clamicun

  • Member
  • ***
  • Posts: 335
Re: Popup Menu
« Reply #25 on: April 18, 2019, 12:13:49 AM »
HSE,
I was talking on the strange results in mbi.RcBar. xxx
They are not strange at all if you know, that they correspond to Screendimensions
« Last Edit: April 18, 2019, 05:34:15 AM by clamicun »

HSE

  • Member
  • *****
  • Posts: 1010
  • <AMD>< 7-32>
Re: Popup Menu
« Reply #26 on: April 18, 2019, 01:00:41 AM »
Work perfect but is owner Window handle:
Code: [Select]
   invoke GetMenuBarInfo, hWnd, OBJID_MENU,0, addr mbi


clamicun

  • Member
  • ***
  • Posts: 335
Re: Popup Menu
« Reply #27 on: April 20, 2019, 08:14:14 PM »
No chance to colorize the menubar
??

jj2007

  • Member
  • *****
  • Posts: 9462
  • Assembler is fun ;-)
    • MasmBasic
Re: Popup Menu
« Reply #28 on: April 20, 2019, 09:18:46 PM »
No chance to colorize the menubar

Why don't you go for The Real Thing - a toolbar?

clamicun

  • Member
  • ***
  • Posts: 335
Re: Popup Menu
« Reply #29 on: April 20, 2019, 10:42:28 PM »
jj,

The Real Thing ... What actually is the differenz between toolbar and menubar ?

btw.
7-zip: Die Datei  ToolbarDemoJpg.zip kann nicht geƶffnet werden. Ist kein Archiv.
Not important if it is just a picture