1

I wrote an Alt-Tab replacement application. I use DwmQueryThumbnailSourceSize to determine window sizes, and construct my layout. However this function is available only after I have already constructed the Dwm thumbnails. If I knew the window sizes beforehand, my application could be faster, cleaner, and more elegant.

I tried getting window size information from GetWindowRect, GetWindowPlacement, DWMWA_EXTENDED_FRAME_BOUNDS, but they all seem to return incorrect values for various situations, especially for minimized windows. Only DwmQueryThumbnailSourceSize returns the correct dimensions.

So how do I get the exact window sizes without actually calling DwmQueryThumbnailSourceSize?

Frigo
  • 1,709
  • 1
  • 14
  • 32
  • 1
    _"Only DwmQueryThumbnailSourceSize returns the correct dimensions."_ -- I still don't understand why you are not using it. _"this function is available only after I have already constructed the Dwm thumbnails"_ -- why is this a problem? Maybe some source code to illustrate would help. – zett42 Jan 11 '18 at 08:09
  • [Source is here](https://github.com/FrigoCoder/FrigoTab/). The relevant code is in ApplicationWindows and Layout, maybe BackgroundWindows. ApplicationWindows constructs the appropriate Dwm thumbnails, then passes them to Layout which does the layout and resizes them, based on their reported window sizes. This is what I would like to avoid, I want to construct Dwm thumbnails with the appropriate size right away, but for that Layout needs to know the window sizes beforehand. – Frigo Jan 11 '18 at 22:24

0 Answers0