Beispiel #1
0
        /// <summary>
        /// Updates the taskbar icons with data provided by a given
        /// <see cref="NotifyIconData"/> instance.
        /// </summary>
        /// <param name="data">Configuration settings for the NotifyIcon.</param>
        /// <param name="command">Operation on the icon (e.g. delete the icon).</param>
        /// <param name="flags">Defines which members of the <paramref name="data"/>
        /// structure are set.</param>
        /// <returns>True if the data was successfully written.</returns>
        /// <remarks>See Shell_NotifyIcon documentation on MSDN for details.</remarks>
        public static bool WriteIconData(ref NotifyIconData data, NotifyCommand command, IconDataMembers flags)
        {
            //do nothing if in design mode
            if (IsDesignMode)
            {
                return(true);
            }

            data.ValidMembers = flags;
            lock (SyncRoot)
            {
                return(WinApi.Shell_NotifyIcon(command, ref data));
            }
        }
Beispiel #2
0
 /// <summary>
 /// Updates the taskbar icons with data provided by a given
 /// <see cref="NotifyIconData"/> instance.
 /// </summary>
 /// <param name="data">Configuration settings for the NotifyIcon.</param>
 /// <param name="command">Operation on the icon (e.g. delete the icon).</param>
 /// <returns>True if the data was successfully written.</returns>
 /// <remarks>See Shell_NotifyIcon documentation on MSDN for details.</remarks>
 public static bool WriteIconData(ref NotifyIconData data, NotifyCommand command)
 {
     return(WriteIconData(ref data, command, data.ValidMembers));
 }