Exemplo n.º 1
0
 private void originForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (this._thumbnail != null)
     {
         this._thumbnail.Dispose();
         this._thumbnail = null;
     }
 }
Exemplo n.º 2
0
 private void RecomputeParentForm()
 {
     Form topLevelControl = base.TopLevelControl as Form;
     if (topLevelControl == null)
     {
         this._topLevelForm = null;
         if (this._thumbnail != null)
         {
             this._thumbnail.Dispose();
             this._thumbnail = null;
         }
     }
     else
     {
         if ((this._thumbnail != null) && (this._topLevelForm != topLevelControl))
         {
             this._thumbnail.Dispose();
             this._thumbnail = null;
         }
         this._topLevelForm = topLevelControl;
     }
 }
Exemplo n.º 3
0
        private void RecomputeParentForm()
        {
            Form topLevelControl = base.TopLevelControl as Form;

            if (topLevelControl == null)
            {
                this._topLevelForm = null;
                if (this._thumbnail != null)
                {
                    this._thumbnail.Dispose();
                    this._thumbnail = null;
                }
            }
            else
            {
                if ((this._thumbnail != null) && (this._topLevelForm != topLevelControl))
                {
                    this._thumbnail.Dispose();
                    this._thumbnail = null;
                }
                this._topLevelForm = topLevelControl;
            }
        }
Exemplo n.º 4
0
 public static void Unregister(Thumbnail handle)
 {
     if ((handle != null) && !handle.IsInvalid)
     {
         handle.Close();
     }
 }
Exemplo n.º 5
0
 public static extern int DwmUpdateThumbnailProperties(Thumbnail hThumbnailId, ref DwmThumbnailProperties ptnProperties);
Exemplo n.º 6
0
 public static extern int DwmRegisterThumbnail(IntPtr hwndDestination, IntPtr hwndSource, out Thumbnail phThumbnailId);
Exemplo n.º 7
0
 public static extern int DwmQueryThumbnailSourceSize(Thumbnail hThumbnail, out DwmSize pSize);
Exemplo n.º 8
0
 public void SetThumbnail(IntPtr originHandle)
 {
     this.RecomputeParentForm();
     if (this._topLevelForm == null)
     {
         throw new Exception("Control must have an owner.");
     }
     this._thumbnail = DwmManager.Register(this._topLevelForm, originHandle);
     this.UpdateThumbnail(base.Visible);
 }