Ejemplo n.º 1
0
        public TaskbarButton(VisibleWindow window)
        {
            if (window == null)
                throw new ArgumentNullException("window", "window is null.");
            Window = window;
            Icon = window.Icon;
            Image = Icon.ToBitmap();
            Text = window.Title;
            Margin = Padding.Empty;

            //TODO: find a way to do this managed...
            //      it just doesnt work to call this and use
            //      a managed VisualStyleRenderer instead =/
            UxTheme.SetWindowTheme(base.Handle, "Taskband", null);
        }
Ejemplo n.º 2
0
 private void RemoveButton(VisibleWindow window)
 {
     if (_buttonMap.ContainsKey(window.Hwnd))// && !window.IsMinimized)
     {
         _flp.Controls.Remove(_buttonMap[window.Hwnd]);
         _buttonMap[window.Hwnd].Dispose();
         _buttonMap.Remove(window.Hwnd);
         window.ShowButtonOnTaskbar(true);
     }
 }
Ejemplo n.º 3
0
 private void AddButton(VisibleWindow window)
 {
     if (!_buttonMap.ContainsKey(window.Hwnd))
     {
         var btn = new TaskbarButton(window)
         {
             Height = GetButtonHeight(),
             Width = GetButtonWidth(),
         };
         _flp.Controls.Add(btn);
         _buttonMap.Add(window.Hwnd, btn);
         window.ShowButtonOnTaskbar(false);
     }
 }