vc++中的HWND是什么 [英] what is HWND in vc++

查看:41
本文介绍了vc++中的HWND是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hai....c# 中 HWND(vc++) 的等价物是什么,因为我想将 HWND 从我的 C# 程序发送到 VC++ dll

hai....what is the equivalent of HWND(vc++) in c#,because i want to send HWND from my c# program to the VC++ dll

推荐答案

HWND 是窗口句柄",是 Win32 API 的一部分.HWND 本质上是指针 (IntPtr),其值使它们(某种程度上)指向窗口结构数据.一般来说,HWND 是应用 ADT 模型的一部分.

HWND is a "handle to a window" and is part of the Win32 API . HWNDs are essentially pointers (IntPtr) with values that make them (sort of) point to a window-structure data. In general HWNDs are part an example for applying the ADT model.

如果您想要控件的 HWND,请参阅 Control.处理属性.它是一个 IntPtr,其值为 HWND.

If you want a Control's HWND see Control.Handle property. It is an IntPtr which value is an HWND.

由于 HWND 不是 .Net 实体,因此需要手动释放它们.这是通过 Control.DestroyHandle().

Since HWND are not a .Net entity, they need to be released manually. This is done with Control.DestroyHandle().

密切关注 HWND 的创建和销毁.对象销毁的责任在 .Net 中并不常见,并且通常是错误和内存泄漏的来源.

Pay close attention to creation and destruction of HWND. Responsibility for object destruction is unusual in .Net and is in general a source for bugs and memory leaks.

这篇关于vc++中的HWND是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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