News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Popup Menu

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

Previous topic - Next topic

clamicun

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

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 ?

aw27

I understand your code is secret and you can't publish it but I have no idea what you are doing.

clamicun

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)

aw27

If the function returns false then  use GetLastError to know the exact reason for the error.   ;)

clamicun

AW,
???
I wrote that already. With your modified structure the function GetMenuBarInfo returns 1.
I am talking about the values of _mbi.rcBar.

aw27

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

#22
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

clamicun

By now I read about 15 articles on GetMenuBarInfo.
I swear noone mentioned that the values returned by mbi.rcBar. ...
correspond to screendimensions.

HSE

Clamicum:

You have not posted files using structure.

Sometimes I forgot to make (before to getinfo):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)
Equations in Assembly: SmplMath

clamicun

#25
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

HSE

Work perfect but is owner Window handle:   invoke GetMenuBarInfo, hWnd, OBJID_MENU,0, addr mbi


Equations in Assembly: SmplMath

clamicun

No chance to colorize the menubar
??

jj2007

Quote from: clamicun on April 20, 2019, 08:14:14 PM
No chance to colorize the menubar

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

clamicun

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