예제 #1
0
 private void originForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (this._thumbnail != null)
     {
         this._thumbnail.Dispose();
         this._thumbnail = null;
     }
 }
예제 #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;
     }
 }
예제 #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;
            }
        }
예제 #4
0
 public static void Unregister(Thumbnail handle)
 {
     if ((handle != null) && !handle.IsInvalid)
     {
         handle.Close();
     }
 }
예제 #5
0
 public static extern int DwmUpdateThumbnailProperties(Thumbnail hThumbnailId, ref DwmThumbnailProperties ptnProperties);
예제 #6
0
 public static extern int DwmRegisterThumbnail(IntPtr hwndDestination, IntPtr hwndSource, out Thumbnail phThumbnailId);
예제 #7
0
 public static extern int DwmQueryThumbnailSourceSize(Thumbnail hThumbnail, out DwmSize pSize);
예제 #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);
 }