是否可以利用由另一个进程创建的 HWND? [英] is it possible to draw on HWND created by another process?

查看:24
本文介绍了是否可以利用由另一个进程创建的 HWND?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的程序中创建窗口,然后将此窗口的 HWND 发送到另一个应用程序.在窗口的 HDC 上绘图是否对另一个进程有效?

I am creating window inside my program, then sending HWND of this window to another application. Will drawing on window's HDC be valid for another process?

推荐答案

Windows 由其他窗口拥有,而不是由进程拥有.您可以在桌面上绘制任何 HWND(至少如果窗口具有相同的完整性——我不确定如果不这样做会发生什么).

Windows are owned by other windows, not by processes. You can draw to any HWND on your desktop (at least if the window has the same integrity -- I'm not sure what happens if they don't).

在单独进程中托管插件或选项卡的 Web 浏览器通常会使用此功能.

Web browsers that host plug-ins or tabs in a separate process generally make use of this functionality.

这篇关于是否可以利用由另一个进程创建的 HWND?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆