Ejemplo n.º 1
0
 public static void SetOverlayIcon(this Form form, Icon icon, string description = "")
 {
     if (_Supported)
     {
         _Instance.SetOverlayIcon(form.Handle, icon.Handle, description);
     }
 }
Ejemplo n.º 2
0
 private void SetTaskbarIcon()
 {
     if (_taskbarList != null && _isWin7TaskBar && AdminHelper.IsAdmin)
     {
         try
         {
             _taskbarList.SetOverlayIcon(_taskbarParent, Properties.Resources.shield16.Handle, "Elevated");
         }
         catch { }
     }
 }
Ejemplo n.º 3
0
        private HRESULT _UpdateOverlay(bool attached)
        {
            var source = Overlay;

            if (null == source || !attached)
            {
                return(_taskbarList.SetOverlayIcon(_hwndSource.Handle, IntPtr.Zero, null));
            }
            var hicon = IntPtr.Zero;

            try
            {
                hicon = _GetHICONFromImageSource(source, _overlaySize);
                return(_taskbarList.SetOverlayIcon(_hwndSource.Handle, hicon, null));
            }
            finally
            {
                Utility.SafeDestroyIcon(ref hicon);
            }
        }
Ejemplo n.º 4
0
        public static void SetOverlayIcon(Form fWindow, Icon iconOverlay,
                                          string strDescription)
        {
            if (!EnsureInitialized())
            {
                return;
            }

            try
            {
                m_tbList.SetOverlayIcon(fWindow.Handle, ((iconOverlay == null) ?
                                                         IntPtr.Zero : iconOverlay.Handle), strDescription);
            }
            catch (Exception) { Debug.Assert(false); }
        }
Ejemplo n.º 5
0
        private HRESULT _UpdateOverlay(bool attached)
        {
            ImageSource source = Overlay;

            // The additional string at the end of SetOverlayIcon sets the accDescription
            // for screen readers.  We don't currently have a property that utilizes this.

            if (null == source || !attached)
            {
                return(_taskbarList.SetOverlayIcon(_hwndSource.Handle, IntPtr.Zero, null));
            }

            IntPtr hicon = IntPtr.Zero;

            try
            {
                hicon = _GetHICONFromImageSource(source, _overlaySize);
                return(_taskbarList.SetOverlayIcon(_hwndSource.Handle, hicon, null));
            }
            finally
            {
                Utility.SafeDestroyIcon(ref hicon);
            }
        }