有什么办法可以在Windows下为一个进程挂钩整个绘图功能吗?
我想捕获窗口显示的所有内容。另一方面,如果该窗口实际上在屏幕上不显示任何内容,那就太好了。如何?该过程将调用绘图函数,我的函数将挂钩并将其绘制到其他地方(例如位图文件)并返回,而不实际在屏幕上绘制。
我所知道的是,在Windows NT体系结构中,每个线程都有一个系统调用表,您可以将单个线程的系统调用表(或只是在开始时设置)更改为您的函数。通过仅更改绘图 api(GDI?)(我不确定如果应用程序使用 directx 渲染我将如何生存,但也许有办法)我觉得我可以做到。我可以吗?如果应用程序使用 DirectX 渲染,我该怎么办?
预先感谢,
阿里维利
I want to capture everything what a window displays. On the other hand, it will be very nice if that window doesn't actually display nothing on the screen. How? The process will call drawing functions, my function will hook and draw it to somewhere else (for example into a bitmap file) and return without actually drawing on screen.
What I know is, in Windows NT architecture, every thread has a system call table and you can change system call table of a single thread (or just set it in the beginning) to your functions. By only changing drawing api (GDI?) (i am not sure how I would survive if application uses directx rendering but maybe there is a way) i feel that I can do it. Can I? What should I do if the application uses DirectX rendering?
Thanks in advance,
Ali Veli
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终只挂钩了类似 CreateDC 的函数,使其始终创建内存设备上下文并让所有其他函数利用该内存 DC。
I ended up hooking only CreateDC-like functions, made it always creating a memory device context and letting all other functions draw on that memory DC.