public static void Register(Type t) { var guid = t.GUID.ToString("B"); try { var registryKey = Registry.ClassesRoot.CreateSubKey($@"CLSID\{guid}"); registryKey.SetValue(null, GetToolbarName(t)); var subKey = registryKey.CreateSubKey("Implemented Categories"); subKey.CreateSubKey(ComponentCategoryManager.CATID_DESKBAND.ToString("B")); Console.WriteLine($"Succesfully registered deskband `{GetToolbarName(t)}` - GUID: {guid}"); if (GetToolbarRequestToShow(t)) { Console.WriteLine($"Request to show deskband."); ///https://www.pinvoke.net/default.aspx/Interfaces.ITrayDeskband BandOperate.ShowBand(t); } } catch (Exception) { Console.Error.WriteLine($"Failed to register deskband `{GetToolbarName(t)}` - GUID: {guid}"); throw; } }
private void Button_Click(object sender, RoutedEventArgs e) { BandOperate.ShowBand(typeof(QTranse)); }