简体   繁体   English

如何使用DWMWA_FREEZE_REPRESENTATION冻结实时缩略图?

[英]How do I freeze a live thumbnail using DWMWA_FREEZE_REPRESENTATION?

I'm successfully projecting another windows' content (in my test case now, notepad) into my own window. 我成功地将另一个窗口的内容(在我的测试用例中,记事本中)投射到我自己的窗口中。 It works just fine. 它工作得很好。

What I don't manage to do is freezing it, as offered by the API using DwmSetWindowAttribute ( here ) with the parameter DWMWA_FREEZE_REPRESENTATION ( here ), which equals 15 according to the internet. 我无法做的就是冻结它,正如API提供的那样,使用DwmSetWindowAttribute此处 )和参数DWMWA_FREEZE_REPRESENTATION此处 ),根据互联网等于15。

dwmSetWindowAttribute(MyWindow,15,@Value,1)

I've tried literally all the variants. 我已经尝试了所有的变种。 Sending 1 byte, sending 4 bytes, value 1, 0, "maxdword" etc. etc. The return value is always -2147024809 , which - unless i get that wrong - means "Invalid Parameter". 发送1个字节,发送4个字节,值1,0,“maxdword”等。返回值始终为-2147024809 ,除非我得到错误,否则表示“无效参数”。

Using a workaround by grabbing the DC of the window I am projecting isn't an option due to the slowness of BitBlt. 由于BitBlt的缓慢,通过抓住我正在投影的窗口的DC而不是一个选项。 I've stumbled across dwm thumbnails after looking for reasonably quickly implementable alternatives. 在寻找合理快速实施的替代方案之后,我偶然发现了dwm缩略图。

Searching the internet for DWMWA_FREEZE_REPRESENTATION does not yield me anything useful at all, as if no one else even tries using it. 在互联网上搜索DWMWA_FREEZE_REPRESENTATION并没有给我任何有用的东西,好像没有其他人甚至尝试使用它。 I guess my question will soon be the number one search result on google. 我想我的问题很快就会成为google上排名第一的搜索结果。

Running on Windows 10's May update. 在Windows 10上运行可能会更新。

How can I get this to work? 我怎样才能让它发挥作用?

The 3rd and 4th parameters are really BOOL* and sizeof(BOOL) , but the 1st needs to be a UWP window. 第3和第4个参数实际上是BOOL*sizeof(BOOL) ,但第1个参数需要是UWP窗口。 DWMWA_FREEZE_REPRESENTATION is only available for UWP windows which is not metioned in document. DWMWA_FREEZE_REPRESENTATION仅适用于文档中未DWMWA_FREEZE_REPRESENTATION的UWP窗口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM