有对话框里的控件的句柄,怎么得到
没有的时候呢?
没有的时候呢?
解决方案 »
- 微软BulkUsb读写问题???
- 动态库实现socket客户端多线程
- 怎么才能从EDIT控件里读入16进制
- 请介绍一下VD技术是什么东西?
- (百分求助!) 怎么才能把打开的Access数据库中的记录保存为一个文本文件?
- ListView怎样得到当前选择的ListItem?
- 100分问个简单点的问题
- 用windows sdk写的对话框,为什么里面的文本框输入没反应?(没分了)
- FreeLibrary中清理DLL自己创建线程的问题
- Syntax error(missing operator)in query expression这个错误如何解决?
- 请教:我从网上下了一个多文档的程序框架,但是用WTL库开发的,而我做的几个动态链接库是用MFC的,两者能否合到一起?有没有介绍这方面的
- 怎么设定生成的可执行文件的图标?
HWND hwnd = pWnd->GetSafeHwnd();
符合你的要求吗?
如果不明白,你可以
(1),给我发短消息(请附帖子的地址).
(2),根据http://www.vcshare.net上的联系方式与我联系,推荐QQ.
(3),如果问题简单,请在http://www.vcshare.net/bbs上发帖.
如果问题比较复杂,请把代码压成*.rar当附件发在我的论坛上发帖.
同时在www.csdn.net上发帖,并给出在我的论坛的链接.
---------------
压代码前,请先删除debug,release文件夹,及*.opt,*.ncb,*.plg,*.aps.
GetParent(控件句柄);
MFC:
(GetDlgItem(控件ID)->GetParent())->GetSafeHwnd();
[in] Handle to the dialog box that contains the control.
nIDDlgItem
[in] Specifies the identifier of the control to be retrieved. You can use the GetDlgItem function with any parent-child window pair, not just with dialog boxes. As long as the hDlg parameter specifies a parent window and the child window has a unique identifier (as specified by the hMenu parameter in the CreateWindow or CreateWindowEx function that created the child window), GetDlgItem returns a valid handle to the child window.