gpt4 book ai didi

windows - 如何在窗外画画?

转载 作者:行者123 更新时间:2023-12-04 23:10:21 25 4
gpt4 key购买 nike

看着 window tooltips类提示窗口,我看到它绘制了它的阴影 提示窗口的实际矩形。
使用 spy XX - 我可以获得工具提示的窗口矩形和类样式:

Rectangle:     (440, 229)-(544, 249), 104x20
Restored Rect: (440, 229)-(544, 249), 104x20
Client Rect: (0, 0)-(104, 20), 104x20
您会注意到您看到的投影实际上位于正在绘制的窗口之外。我怎样才能在我的 window 周围画一个阴影,同时是 我的 window ?
备注 : The shadow is not drawn using the standard CS_DROPSHADOW class style.我已经通过实验证实了这一点,并且还可以在 中查看窗口的类样式 spy XX ;它不使用 CS_DROPSHADOW :
Windows Styles:     94000001

WS_POPUP 80000000
WS_VISIBLE 10000000
WS_CLIPSIBLINGS 4000000
TTS_ALWAYSTIP 1

Extended Styles: 00080088

WS_EX_LAYERED 80000
WS_EX_TOOLWIN 80
WS_EX_TOPMOST 8
那么我怎样才能在窗外画画呢?
注:试图在桌面 DC 上绘图已出。来自 Greg Schechter 的 Redirecting GDI, DirectX, and WPF applications :

Drawing To and Reading From the Screen-- Baaaad!

Lastly, since we're on the redirectiontopic, one particularly dangerouspractice is writing to the screen,either through the use of GetDC(NULL)and writing to that, or attempting todo XOR rubber-band lines, etc. Thereare two big reasons that writing tothe screen is bad:

It's expensive... writing to thescreen itself isn't expensive, but itis almost always accompanied byreading from the screen because onetypically does read-modify-writeoperations like XOR when writing tothe screen. Reading from the videomemory surface is very expensive,requires synchronization with the DWM,and stalls the entire GPU pipe, aswell as the DWM application pipe.
It's unpredictable... if you somehowmanage to get to the actual primaryand write to it, there can be nopredictability as to how long what youwrote to the primary will remain onscreen. Since the UCE doesn't knowabout it, it may get cleared in thenext frame refresh, or it may persistfor a very long time, depending onwhat else needs to be updated on thescreen. (We really don't allow directwriting to the primary anyhow, forthat very reason... if you try toaccess the DirectDraw primary, forinstance, the DWM will turn off untilthe accessing application exits)

最佳答案

你不能以你描述的方式在窗外画画。

如果您右键单击桌面然后转到属性/外观/效果并取消选中“在菜单下显示阴影”......您将不再有阴影。

底线是这是窗口管理器的产品,而不是您的程序。

关于windows - 如何在窗外画画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2232727/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com