Exemplo n.º 1
0
 /// <summary>
 /// Release the handle
 /// </summary>
 /// <returns>true if handled is release successfully, false otherwise</returns>
 protected override bool ReleaseHandle()
 {
     if (CoreNativeMethods.DestroyIcon(handle))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Release the native and managed objects
        /// </summary>
        /// <param name="disposing">Indicates that this is being called from Dispose(), rather than the finalizer.</param>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                // dispose managed resources here
            }

            // Unmanaged resources
            if (hIcon != IntPtr.Zero)
            {
                CoreNativeMethods.DestroyIcon(hIcon);
            }
        }
Exemplo n.º 3
0
        private void UpdateHIcon()
        {
            if (invalidateIcon)
            {
                if (hIcon != IntPtr.Zero)
                {
                    CoreNativeMethods.DestroyIcon(hIcon);
                }

                hIcon = GetHIcon();

                invalidateIcon = false;
            }
        }