public static void Register(string DefaultIcon, string Title, bool Bounceable) { if (!IsRegistered) { Initilize(); iconName = DefaultIcon; title = Title; bounceable = Bounceable; using (var parameters = new Parameters()) { Id = APICall(parameters .AddInt((int)Function.Register) .AddString(Process.GetCurrentProcess().MainModule.FileName) .AddInt(HwndSource.Handle.ToInt32()) .AddString(DefaultIcon) .AddString(Title) .AddInt((int)UId) .AddInt(Bounceable ? 1 : 0)); } using (var parameters = new Parameters()) { UId = APICall(parameters .AddInt((int)Function.GetUId) .AddInt((int)Id)); } } }
public static void BounceStop() { if (IsRegistered) { using (var parameters = new Parameters()) { APICall(parameters .AddInt((int)Function.BounceStop) .AddInt((int)Id)); } } }
private static void GetConfig() { if (IsRegistered) { using (var parameters = new Parameters()) { APICall(parameters .AddInt((int)Function.GetConfig) .AddInt((int)Id)); } } }
public static void RemoveFolderWatcher(int FolderId) { if (IsRegistered) { using (var parameters = new Parameters()) { APICall(parameters .AddInt((int)Function.RemoveFolderWatcher) .AddInt((int)Id) .AddInt(FolderId)); } } }
public static void Bounce(BounceType Type, int Count) { if (IsRegistered) { using (var parameters = new Parameters()) { APICall(parameters .AddInt((int)Function.Bounce) .AddInt((int)Id) .AddInt((int)Type) .AddInt((int)Count)); } } }
public static void Remove() { if (IsRegistered) { using (var parameters = new Parameters()) { APICall(parameters .AddInt((int)Function.Remove) .AddInt((int)Id)); } Id = IntPtr.Zero; UId = IntPtr.Zero; } }
public static void SetNotification(bool Visible, string Text, NotificationPosition Position) { if (IsRegistered) { using (var parameters = new Parameters()) { APICall(parameters .AddInt((int)Function.SetNotification) .AddInt((int)Id) .AddInt((int)(Visible ? 1 : 0)) .AddString(Text) .AddInt((int)Position)); } } }
public static void AddFolderWatcher(int FolderId, FolderWatcherActions Actions, string Folder) { if (IsRegistered) { using (var parameters = new Parameters()) { APICall(parameters .AddInt((int)Function.AddFolderWatcher) .AddInt((int)Id) .AddInt(FolderId) .AddInt((int)Actions) .AddString(Folder)); } } }
private static void SetConfig() { if (IsRegistered) { using (var parameters = new Parameters()) { APICall(parameters .AddInt((int)Function.SetConfig) .AddInt((int)Id) .AddInt((int)(keepInDock ? 1 : 0)) .AddInt((int)(activatable ? 1 : 0)) .AddInt((int)(exposable ? 1 : 0)) .AddInt((int)(bounceable ? 1 : 0))); } } }
private static void OnEventGetMenu() { if (GetMenu is EventGetMenu) { var menu = new List <Menu>(); GetMenu(menu); if (IsRegistered) { using (var parameters = new Parameters()) { parameters.AddInt((int)Function.GetMenu).AddInt((int)Id).AddInt(menu.Count); for (int i = menu.Count - 1; i >= 0; i--) { parameters.AddStructure(menu[i]); } APICall(parameters); } } } }
private static void OnEventGetMenu() { if (GetMenu is EventGetMenu) { var menu = new List<Menu>(); GetMenu(menu); if (IsRegistered) { using (var parameters = new Parameters()) { parameters.AddInt((int)Function.GetMenu).AddInt((int)Id).AddInt(menu.Count); for (int i = menu.Count - 1; i >= 0; i--) { parameters.AddStructure(menu[i]); } APICall(parameters); } } } }