News:

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

Main Menu

GetMenuBarInfo

Started by jj2007, May 08, 2014, 12:56:37 AM

Previous topic - Next topic

jj2007

Hi everybody,

Does qWord's GetMenuBarInfo example still work? I am on Win7-32 now, and it fails consistently with invalid parameter...

Note some assemblers complain about redefinition. Just put an if 0 ... endif around the MENUBARINFO definition on top.

Gunther

Jochen,

could you attach the right source for jWasm?

Gunther
You have to know the facts before you can distort them.

qWord

The structure declaration in windows.inc is wrong.
MREAL macros - when you need floating point arithmetic while assembling!

Gunther

Hi qWord,

Quote from: qWord on May 08, 2014, 01:18:06 AM
The structure declaration in windows.inc is wrong.

thank you for the information. What's wrong?

Gunther
You have to know the facts before you can distort them.

qWord

The last two members (with "f" prefix) are bit fields:
typedef struct tagMENUBARINFO
{
    DWORD cbSize;
    RECT rcBar;          // rect of bar, popup, item
    HMENU hMenu;         // real menu handle of bar, popup
    HWND hwndMenu;       // hwnd of item submenu if one
    BOOL fBarFocused:1;  // bar, popup has the focus
    BOOL fFocused:1;     // item has the focus
} MENUBARINFO, *PMENUBARINFO, *LPMENUBARINFO;

The structure in windows.inc use two BOOLs instead of one SDWORD (BOOL).
Interestingly the  declaration that can be found on MSDN is also wrong.
MREAL macros - when you need floating point arithmetic while assembling!

jj2007

Quote from: qWord on May 08, 2014, 01:42:59 AM
The structure in windows.inc use two BOOLs instead of one SDWORD (BOOL).

In clear violation of assembly rule #1: everything is a DWORD ;-)

Thanks, it works :t