with normal CEdit class it is coming fine.
this is my newEdit class
#include "stdafx.h"
#include "SampleApp.h"
#include "newEdit.h"
this is my newEdit class
IMPLEMENT_DYNAMIC(newEdit, CDialog)
newEdit::newEdit(CWnd* pParent )
: CDialog(newEdit::IDD, pParent)
{
}
newEdit::~newEdit()
{
}
void newEdit::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(newEdit, CDialog)
ON_WM_SETFOCUS()
END_MESSAGE_MAP()
void newEdit::OnSetFocus(CWnd* pOldWnd)
{
CDialog::OnSetFocus(pOldWnd);
HWND hWndKeybdDlg = ::FindWindow(NULL, _T("keyboard"));
if( hWndKeybdDlg )
{
::SendMessage(hWndKeybdDlg, WM_USER+1, (WPARAM)m_hWnd, 0);
}
}
in the OnInitDialog function of the main dialog, i set a HWND member variable to point to the Edit Ctrl's handle.
m_hWndEdit = m_eBox.m_hWnd;
after doin some functionality,
::SetFocus(m_hWndEdit);
is called.
i have included
ON_MESSAGE(WM_USER+1, &CSampleAppDlg::OnInputEnable)
to do the message mapping.
one doubt i have is, i have jus typed in the above code for the map. should i be doing something else for the override?