03-31-2003 09:55 AM
03-31-2003 10:55 AM
04-03-2003 11:38 AM
04-04-2003 01:42 AM
04-04-2003 10:41 AM
04-07-2003 01:33 AM
04-09-2003 10:44 AM
04-10-2003 01:23 AM
04-10-2003 09:57 AM
06-25-2007 06:07 AM
Hi,
I write the following code on VisualStudio2005 and Measurement Studio 8.0.1, where CWaveGenPage is derived from CPropertyPage and m_cwspinEdit is a variable of CNiNumEdit. I found a problem when I edit the text of m_cwspinEdit on the GUI of my application, method1 fails to trap the message but at the same time method2 works well. How do I trap the flow by comparing the window handle?
Thanks!
CWaveGenPage::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if ( pMsg->message == WM_CHAR ){
HWND hWndCtl = ::GetFocus();
//method1
if ( hWndCtl == m_cwspinEdit.m_hWnd ){
//Should trap the message here but actually never.........
m_cwspinEdit..Value = 1.23;
}
//method2
char buf[24];
sprintf(buf, "%f", 1.23);
::SetWindowText(hWndCtl, buf);
}
return CPropertyPage::PreTranslateMessage(pMsg);
}