Example #1
0
        private void UpdateThumbnail()
        {
            if (_targetHwnd.ToInt32() == 0) //no target
            {
                return;
            }
            var props = new DwmThumbnailProperties();

            props.dwFlags = 0x11; //destination and client area only
            //props.rcDestination.Left = 0;// this.Bounds.Left;
            //props.rcDestination.Right = this.Bounds.Width;
            //props.rcDestination.Top = 0;// this.Bounds.Top;
            //props.rcDestination.Bottom = this.Bounds.Height;
            props.fSourceClientAreaOnly = true;
            //Rect targetWindow;
            //Rect targetClient;
            bool result = Win32.GetClientRect(this.Handle, out props.rcDestination);

            //props.rcDestination.Left = -1;// this.Bounds.Left;
            //props.rcDestination.Top = -1;// this.Bounds.Top;
            //props.rcDestination.Right++;
            //props.rcDestination.Bottom++;
            //bool result = Win32.GetWindowRect(, out props.rcDestination);
            //props.rcDestination.Right = this.Bounds.Width * props.rcDestination.Right / this.Bounds.Width;
            //props.rcDestination.Bottom = this.Bounds.Height;
            Win32.DwmUpdateThumbnailProperties(_thumbHandle, ref props);
        }
Example #2
0
 public static extern void DwmUpdateThumbnailProperties(IntPtr hThumbnailId,ref DwmThumbnailProperties ptnProperties);
Example #3
0
 private void UpdateThumbnail()
 {
     if (_targetHwnd.ToInt32() == 0) //no target
         return;
     var props = new DwmThumbnailProperties();
     props.dwFlags = 0x11; //destination and client area only
     //props.rcDestination.Left = 0;// this.Bounds.Left;
     //props.rcDestination.Right = this.Bounds.Width;
     //props.rcDestination.Top = 0;// this.Bounds.Top;
     //props.rcDestination.Bottom = this.Bounds.Height;
     props.fSourceClientAreaOnly = true;
     //Rect targetWindow;
     //Rect targetClient;
     bool result = Win32.GetClientRect(this.Handle, out props.rcDestination);
     //props.rcDestination.Left = -1;// this.Bounds.Left;
     //props.rcDestination.Top = -1;// this.Bounds.Top;
     //props.rcDestination.Right++;
     //props.rcDestination.Bottom++;
     //bool result = Win32.GetWindowRect(, out props.rcDestination);
     //props.rcDestination.Right = this.Bounds.Width * props.rcDestination.Right / this.Bounds.Width;
     //props.rcDestination.Bottom = this.Bounds.Height;
     Win32.DwmUpdateThumbnailProperties(_thumbHandle, ref  props);
 }
Example #4
0
 public static extern void DwmUpdateThumbnailProperties(IntPtr hThumbnailId, ref DwmThumbnailProperties ptnProperties);