How can I prevent another program from showing a thumbnail preview in the taskbar?

Raymond Chen

Raymond

A customer wanted to prevent the Contoso app from showing a thumbnail preview when the user hovers over it in the taskbar. They wrote something like this:

HWND h = FindWindow(TEXT("ContosoMainWindow"), NULL);
BOOL fTrue = TRUE;
DwmSetWindowAttribute(h, DWMWA_FORCE_ICONIC_REPRESENTATION,
    &fTrue, sizeof(fTrue));

They reported that this works for most applications, but if the target is Contoso, then it stops working when Contoso is minimized. They wanted to know if this is expected, and if there is any other way to prevent Contoso from showing a thumbnail preview.

Manipulating the windows of other applications is generally a rather dodgy undertaking. Sometimes you get away with it, sometimes you don’t. And even if you get away with it today, it may stop working tomorrow.

In this case, what happens is that you are changing the configuration of Contoso’s window, and then after you do that, Contoso reconfigures their window in a way you don’t like. I suspect Contoso enables a custom thumbnail on minimize so that they can show a prettier thumbnail than the default thumbnail.

It’s like saying, “I don’t like it when my neighbor keeps his gardening tools next to his shed, so I went into his yard and moved them to behind the shed. But every time he finishes gardening, he puts his tools next to the shed again. How do I make sure my neighbor always puts his gardening tools behind the shed instead of next to it?”

Answer: You can’t. They’re not your gardening tools nor your yard. If you sneak into his yard and move his gardening tools, it’s unreasonable to expect that they will stay where you moved it.

What you can do is have a talk with your neighbor and explain why you would prefer that he keep his gardening tools behind the shed. Maybe you can come to some sort of agreement. The customer should talk to the Contoso support team to see if there’s a policy or other setting for the Contoso app to suppress the thumbnail preview.

10 comments

Comments are closed. Login to edit/delete your existing comments

  • Avatar
    M. W.

    In my experience, talking with people rarely works; I’ve filed countless bug-reports for various programs and websites and reported countless fraudulent listings on eBay and so on, but they usually just they end up being ignored or rejected. Unfortunately, most of the time, the only way to get things done is to just burn down the shed. 🤷

    • Avatar
      Fleet Command

      … at which point the police would arrest and incarcerate you for arson. Rumor has it that in the American prison, other prisoners forcibly reconfigure your face, the painful way.

      On a more serious note, when more than one developer rejects your bug reports, it is high time you realized there is something wrong with your reports.

      • Avatar
        Joshua Hudson

        Microsoft rejects bugs because they don’t want to put in the effort. This means your test is poor. Elsewhere I get better response rate and actual fix rate. But sometimes it just doesn’t get fixed. I remember this one where the musl-libc developers and the glibc developers were each telling the other they were wrong about what a library function should do.

        • Jonathan Harston
          Jonathan Harston

          I’ve had arguments like that.
          min(x,y) should return the smallest value.
          What if they’re equal? I’ve had arguments over whether a=1; b=1; c=min(a,b); should return a or b.

        • Avatar
          Marc K

          It seems like outsourced support reps are either incentivized to close cases or are penalized for letting an issue get escalated. It’s very frustrating when it’s so obvious the rep’s goal is to discard my case as fast as possible. Then some teams are happy to let cases languish forever. I’ve got one case with a firewall vendor that’s been open almost a year now because they deemed a satisfactory work-around is to delete all of the rules and re-renter them by hand from scratch. Still others dump everything they can, even bugs, into an “enhancement database” that no one looks at. I do interact with a few vendors that care about fixing bugs in their products, and it’s a refreshing experience.