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); }
public static extern void DwmUpdateThumbnailProperties(IntPtr hThumbnailId,ref DwmThumbnailProperties ptnProperties);
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); }
public static extern void DwmUpdateThumbnailProperties(IntPtr hThumbnailId, ref DwmThumbnailProperties ptnProperties);