BOOL CAaaDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->hwnd == GetDlgItem(IDC_EDIT1)->m_hWnd){
if(pMsg->message == EN_SETFOCUS)//这儿怎么写?
int a = 5;
}
return CDialog::PreTranslateMessage(pMsg);
}
{
if(pMsg->hwnd == GetDlgItem(IDC_EDIT1)->m_hWnd){
if(pMsg->message == EN_SETFOCUS)//这儿怎么写?
int a = 5;
}
return CDialog::PreTranslateMessage(pMsg);
}
{
if(pMsg-> message == WM_COMMAND && HIWORD(pMsg->wParam) == EN_SETFOCUS && LOWORD(pMsg->wParam) == IDC_EDIT1)
int a = 5;
} // ID和句柄要一个就行了
BOOL CAaaDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg-> hwnd == GetDlgItem(IDC_EDIT1)-> m_hWnd){
//if(pMsg-> message == EN_SETFOCUS)//这儿怎么写?
if(pMsg-> message == WM_SETFOCUS)
int a = 5;
}
return CDialog::PreTranslateMessage(pMsg);
}
idEditCtrl = (int) LOWORD(wParam); // identifier of edit control
wNotifyCode = HIWORD(wParam); // notification code
hwndEditCtrl = (HWND) lParam; // handle of edit control
点击按钮进不去.没产生WM_COMMAND
点击按钮进不去.没产生WM_COMMAND
-----------------------------------
你到底要怎样?按钮?编辑框?
如果要点击按钮让编辑框得到焦点,先要KILL按钮的焦点,再给编辑框设焦点(可以发消息或SetFocus)。你没发消息,干等着,你以为消息会自己来。
-----------------
没KillFocus函数.
{
CWnd *c = GetDlgItem(IDC_EDIT1);
c->SetFocus();
}BOOL CAaaDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_COMMAND){
if(HIWORD(pMsg->wParam) == EN_SETFOCUS){
a = IDC_EDIT1;
if(LOWORD(pMsg->wParam) == IDC_EDIT1)
a = 100;
}
} return CDialog::PreTranslateMessage(pMsg);
}
条件,怎么回事?