I'm a beginner in MFC and I just want my input box selected by default, ready to input text with the keyboard when the input box pops up.
Here is my C++ .cpp file of the class:
testInputBox::testInputBox(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_INPUT_BOX, pParent)
, warning(_T(""))
{
}
testInputBox::~testInputBox()
{
}
void testInputBox::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT_INPUT_BOX, editcedit);
DDX_Text(pDX, IDC_STATIC_MESSAGE, warning);
DDV_MaxChars(pDX, warning, 100);
}
BEGIN_MESSAGE_MAP(testInputBox, CDialogEx)
ON_EN_CHANGE(IDC_EDIT_INPUT_BOX, &testInputBox::OnEnChangeEdit1)
ON_BN_CLICKED(IDOK, &testInputBox::OnBnClickedOk)
ON_BN_CLICKED(IDCANCEL, &testInputBox::OnBnClickedCancel)
ON_STN_CLICKED(IDC_STATIC_MESSAGE, &testInputBox::OnStnClickedStaticMessage)
END_MESSAGE_MAP()