public static void Insert(int index, int id, string text, Window window) { var hookId = window.GetHandle(); var source = HwndSource.FromHwnd(hookId); if (source != null) { DataDic[id] = source; InteropMethods.InsertMenu(InteropMethods.GetSystemMenu(hookId, false), index, InteropValues.MF_BYPOSITION, id, text); source.AddHook(WinProc); } }
public static void InsertSeperator(int index, Window window) => InteropMethods.InsertMenu( InteropMethods.GetSystemMenu(window.GetHandle(), false), index, InteropValues.MF_BYPOSITION | InteropValues.MF_SEPARATOR, 0, "");