コード例 #1
0
 public static void SetOverlayIcon(IntPtr windowHandle, IntPtr iconHandle, string description)
 {
     if (taskbarSupported)
     {
         taskbarInstance.SetOverlayIcon(windowHandle, iconHandle, description);
     }
 }
コード例 #2
0
 public static void SetOverlayIcon(IntPtr hwnd, IntPtr icon, string description)
 {
     if (IsInitialized)
     {
         taskbar.SetOverlayIcon(hwnd, icon, description);
     }
 }
コード例 #3
0
ファイル: TaskbarList.cs プロジェクト: wushian/Vanara
        // Overlays ============================================

        /// <summary>Applies an overlay to a taskbar button to indicate application status or a notification to the user.</summary>
        /// <param name="parent">
        /// The window whose associated taskbar button receives the overlay. This window must belong to a calling process associated with the button's application.
        /// </param>
        /// <param name="icon">
        /// The icon to use as the overlay. This should be a small icon, measuring 16x16 pixels at 96 dpi. If an overlay icon is already applied to the taskbar
        /// button, that existing overlay is replaced.
        /// <para>
        /// This value can be <see langword="null"/>. How a <see langword="null"/> value is handled depends on whether the taskbar button represents a single
        /// window or a group of windows.
        /// </para>
        /// <list type="bullet">
        /// <item><term>If the taskbar button represents a single window, the overlay icon is removed from the display.</term></item>
        /// <item><term>If the taskbar button represents a group of windows and a previous overlay is still available (received earlier than the current overlay, but not yet
        /// freed by a NULL value), then that previous overlay is displayed in place of the current overlay.</term></item>
        /// </list>
        /// </param>
        /// <param name="description">A string that provides an alt text version of the information conveyed by the overlay, for accessibility purposes.</param>
        public static void SetOverlayIcon(IWin32Window parent, Icon icon, string description)
        {
            Validate7OrLater();
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }
            taskbar4?.SetOverlayIcon(parent.Handle, icon == null ? IntPtr.Zero : icon.Handle, description);
        }
コード例 #4
0
        /// <summary>
        /// Applies an overlay to a taskbar button of the main application window to indicate application status or a notification to the user.
        /// </summary>
        /// <param name="icon">The overlay icon</param>
        /// <param name="accessibilityText">String that provides an alt text version of the information conveyed by the overlay, for accessibility purposes</param>
        public void SetOverlayIcon(System.Drawing.Icon icon, string accessibilityText)
        {
            CoreHelpers.ThrowIfNotWin7();

            TaskbarList.SetOverlayIcon(OwnerHandle, icon != null ? icon.Handle : IntPtr.Zero, accessibilityText);
        }