예제 #1
0
        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);
            }
        }
예제 #2
0
 public static void InsertSeperator(int index, Window window) => InteropMethods.InsertMenu(
     InteropMethods.GetSystemMenu(window.GetHandle(), false), index,
     InteropValues.MF_BYPOSITION | InteropValues.MF_SEPARATOR, 0, "");