Pass the form's handle, not the menu bar's.

----- Original Message ----- 
From: "Vaughan, Benjamin Carl" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Monday, August 25, 2003 1:11 PM
Subject: [DUG]: GetMenuBarInfo


Hi,

I am currently attempting to get the size of a Menu using the windows
API method GetMenuBarInfo.

My code is as follows

var
  menuInfo: tagMENUBARINFO;
  res : longbool;
begin
  //tbMenu is the TToolbar that TMainMenu is hooked up to
  res := GetMenuBarInfo(tbMenu.Handle,OBJID_MENU,0,menuInfo)
end;

The method is failing and GetLastError is only giving me the extremely
useful message of "The parameter is incorrect." ,
ERROR_INVALID_PARAMETER.

Does anybody have any idea what would be wrong with this piece of code,
or has anyone used this method before?

Regards
Ben
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to