Menu to the right of the window

Is the menu to the right of the window ?

var

  MENUITEMINFO: TMENUITEMINFO;

  Buffer: array[0..79] of Char; // declared in menu.pas. I wonder why 79.

begin

  FillChar(MENUITEMINFO, SizeOf(MENUITEMINFO), 0);

  // !! Don't use SizeOf(MENUITEMINFO) because it's required for Windows 95

  // !! Cf. Menu.pas

  MENUITEMINFO.cbSize := 44;

  MENUITEMINFO.fMask := MIIM_TYPE;

  MENUITEMINFO.dwTypeData := Buffer;

  MENUITEMINFO.cch := SizeOf(Buffer);

  // Getting info

  if GetMenuItemInfo(MainMenu1.Handle, 1, TRUE, MENUITEMINFO) then

  begin

    MENUITEMINFO.fType := MENUITEMINFO.fType or MFT_RIGHTJUSTIFY;

    if SetMenuItemInfo(MainMenu1.Handle, 1, TRUE, MENUITEMINFO) then

      DrawMenuBar(Handle); // not required if done in OnCreate event



  end;

 

Share this article!

Follow us!

Find more helpful articles: