EnableExplicit Procedure GetMenuTitleWidth(WindowID, MenuID, MenuTitleID) Protected MENURECT.RECT Protected MenuTitleWidth GetMenuItemRect_(WindowID, MenuID, MenuTitleID, MENURECT) MenuTitleWidth = MENURECT\Right-MENURECT\Left ProcedureReturn MenuTitleWidth EndProcedure Procedure GetFullMenuTitleWidth(WindowID, MenuID) Protected a Protected MenuTitleTotal Protected MenuTitleWidthTotal MenuTitleTotal = GetMenuItemCount_(MenuID)-1 For a=0 To MenuTitleTotal MenuTitleWidthTotal + GetMenuTitleWidth(WindowID, MenuID, a) Next ProcedureReturn MenuTitleWidthTotal EndProcedure If OpenWindow(0, 0, 0, 500, 250, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) If CreateMenu(0,WindowID(0)) MenuTitle("Datei");0 MenuTitle("Bearbeiten");1 MenuTitle("Hilfe");2 EndIf Debug "Breite aller MenuTitle: " + GetFullMenuTitleWidth(WindowID(0), MenuID(0)) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf