sdk程序
在setparent之前,edit控件可以向父窗口发送EN_CHANGE通知,但setparent一个新的父窗口之后,edit控件不向新的父窗口发送EN_CHANGE通知,如果把edit换成button,倒是正常,可以收到BN_CLICKED.
不光EN_CHANGE,任何通知消息都没有。
在setparent之前,edit控件可以向父窗口发送EN_CHANGE通知,但setparent一个新的父窗口之后,edit控件不向新的父窗口发送EN_CHANGE通知,如果把edit换成button,倒是正常,可以收到BN_CLICKED.
不光EN_CHANGE,任何通知消息都没有。
解决方案 »
- 如何指定一个线程的生命期
- 相同代码从SQL和Informix两种数据库读出中文的结果不一样?
- 关于用CArray类出现的问题,请教大家.
- 请教,我在MapiMessage 中设置了发件人的邮箱,而且outlook中也有相同的发件人的邮箱,但为何在MapiSendMail后,发件人总是是outlook默认的发
- 急求围棋源代码(在线急)
- !!请教高手:如何消除闪烁问题??请进——
- MFCDLL的OLE初始化问题
- 为什么我的字符串传不过去呀!?
- 如果初始化对话框中的操作失败,这时候我不想弹出该对话框,该怎么做??
- VC.NET ACTIVE控件问题
- 关于MainFrm单文档和托盘的问题??
- malloc最大可分配多大的空间??
An edit, list box, or combo box control sends notifications to the original parent window even after SetParent has been used to change the control's parent. A button control sends notifications to the new parent after SetParent has been used to change its parent. Edit, list box, and combo box controls keep a private copy of the window handle of the parent at the time of creation. This handle is not changed when SetParent is used to change the control's parent. Consequently, the notifications (EN_*, LBN_*, and CBN_* notifications) go to the original parent. Note that WM_PARENTNOTIFY messages go to the new parent and GetParent() returns the new parent. If it is required that notifications go to the new parent window, code must be added to the old parent's window procedure to pass on the notifications to the new parent. For example: case WM_COMMAND:
hwndCtl = LOWORD(lParam); // If notification is from a control and the control is no longer this
// window's child, pass it on to the new parent.
if (hwndCtl && !IsChild(hWnd, hwndCtl))
SendMessage(GetParent(hwndCtl), WM_COMMAND, wParam, lParam);
else Do normal processing;
Button controls send notifications to the new parent after SetParent has been used to change the parent.