Hi Dennis, I was not using the Menu's Handle (in that case I would have got Error 1400, "Invalid Handle".
I had tried the form as well, as the toolbars handle, both returned the same error. Regards Ben -----Original Message----- From: Dennis Chuah [mailto:[EMAIL PROTECTED] Sent: Monday, 25 August 2003 2:08 p.m. To: Multiple recipients of list delphi Subject: Re: [DUG]: GetMenuBarInfo 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/
