Hi Warren,

 

No I was trying to get the size of a TMainMenu. In my case I had stuck it into a Toolbar, but I did a test with it stuck into the main form as well, neither worked, both coming back with the same error.

 

I also had tried the web first but there seems to be very little documentation on this method. I think the solution for now will be to find a replacement for TToolbar that handles resizing correctly.

 

Thanks Anyway.

Ben

 

-----Original Message-----
From: Warren Slater (ASL) [mailto:[EMAIL PROTECTED]]
Sent
:
Monday, 25 August 2003 4:36 p.m.
To: Multiple recipients of list delphi
Subject: RE: Re: [DUG]: GetMenuBarInfo

 

Hi
Are you wanting to get the information for a popup/dropdown menu on a button on the speedbar and not the main form menu? In that case you may need to use OBJID_CLIENT and not OBJID_MENU. I have not done this but was interested and found the following on the microsoft web site.

The GetMenuBarInfo function retrieves information about the specified menu bar.

Syntax

BOOL GetMenuBarInfo(      
    HWND hwnd,
    LONG idObject,
    LONG idItem,
    PMENUBARINFO pmbi
);

Parameters

hwnd

[in] Handle to the window (menu bar) whose information is to be retrieved.

idObject

[in] Specifies the menu object. This parameter can be one of the following values.

OBJID_CLIENT

The popup menu associated with the window.

OBJID_MENU

The menu bar associated with the window (see the GetMenu function).

OBJID_SYSMENU

The system menu associated with the window (see the GetSystemMenu function).

idItem

[in] Specifies the item for which to retrieve information. If this parameter is zero, the function retrieves information about the menu itself. If this parameter is 1, the function retrieves information about the first item on the menu, and so on.

pmbi

[out] Pointer to a MENUBARINFO structure that receives the information. Note that you must set MENUBARINFO.cbSize to sizeof(MENUBARINFO) before calling this function.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.




Reply via email to