Click here to Skip to main content
15,911,141 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralOutlook problem - 'Saved' property for appointment item Pin
YaronNir25-Feb-04 23:34
YaronNir25-Feb-04 23:34 
Generalcannot find afxdao.lib Pin
coda_x25-Feb-04 23:34
coda_x25-Feb-04 23:34 
GeneralPrint Preview Pin
Anonymous25-Feb-04 23:28
Anonymous25-Feb-04 23:28 
GeneralMaking Child Windows of an MDI as an exe Pin
swarnamanoo25-Feb-04 23:26
swarnamanoo25-Feb-04 23:26 
Questioncan we add wave files as resource Pin
25-Feb-04 23:22
suss25-Feb-04 23:22 
AnswerRe: can we add wave files as resource Pin
Monty226-Feb-04 0:01
Monty226-Feb-04 0:01 
GeneralReply: can we add wave files as resource Pin
Sivaji26-Feb-04 23:03
Sivaji26-Feb-04 23:03 
General如何攔截在Edit上按下的Return?(win32 project) Pin
akirachen25-Feb-04 21:17
akirachen25-Feb-04 21:17 
g_hDlgWnd=CreateDialog(g_hInst,MAKEINTRESOURCE(IDD_DIALOG_TEST),hWnd,(DLGPROC)DlgTestProc);
ShowWindow(g_hDlgWnd, SW_SHOWNORMAL);
以function建立一個Dialog(IDD_DIALOG_TEST),在IDD_DIALOG_TEST加入一個IDC_EDIT_INPUTTEXT(Edit Control)
我想在IDC_EDIT_INPUTTEXT按下Return時Call其他的Function,
問題就是:如何攔截在Edit上按下的Return?(win32 project)

INT_PTR CALLBACK DlgTestProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
long rvalue = 0;
/*
int processed = CGM.WinProc(hDlg, message, wParam, lParam, &rvalue);
if (processed)
return rvalue;
*/
switch(message)
{
case WM_INITDIALOG:
return Test_OnInitialDialog(hDlg);

case WM_COMMAND:
switch(LOWORD(wParam))
{

case IDC_EDIT_INPUTTEXT:

{
switch (HIWORD (wParam))
{
//case VK_RETURN:
// TRACE("VK_RETURN\n");
// break;

case EN_CHANGE:
{
CHAR lpszPassword[MAX_TALK_WORD];
WORD cchPassword;

cchPassword = (WORD) SendDlgItemMessage(hDlg,
IDC_EDIT_INPUTTEXT,
EM_LINELENGTH,
(WPARAM) 0,
(LPARAM) 0);

*((LPWORD)lpszPassword) = cchPassword;
// Get the characters.

SendDlgItemMessage(hDlg,
IDC_EDIT_INPUTTEXT,
EM_GETLINE,
(WPARAM) 0, // line 0
(LPARAM) lpszPassword);

// Null-terminate the string.

lpszPassword[cchPassword] = 0;


TRACE(">>>> cchPassword=%d ,lpszPassword=%s \n",cchPassword,lpszPassword);

}

TRACE("IDC_EDIT_INPUTTEXT %d,%d\n",wParam,lParam);

break;
}


}
break;


GeneralRe: 如何攔截在Edit上按下的Return?(win32 project) Pin
Prakash Nadar26-Feb-04 0:44
Prakash Nadar26-Feb-04 0:44 
GeneralRe: 如何攔截在Edit上按下的Return?(win32 project) Pin
toxcct26-Feb-04 3:07
toxcct26-Feb-04 3:07 
GeneralRe: 如何攔截在Edit上按下的Return?(win32 project) Pin
J.B.26-Feb-04 6:15
J.B.26-Feb-04 6:15 
GeneralFirewalls & VC++ FTP application Pin
rasha200325-Feb-04 20:04
rasha200325-Feb-04 20:04 
GeneralRe: Firewalls & VC++ FTP application Pin
Steve S25-Feb-04 22:42
Steve S25-Feb-04 22:42 
GeneralRe: Firewalls & VC++ FTP application Pin
rasha200328-Feb-04 4:42
rasha200328-Feb-04 4:42 
QuestionWhere can I find source code for CPRM (content protection for recordable media)? Pin
George225-Feb-04 18:15
George225-Feb-04 18:15 
GeneralPDF control Pin
Mahesh Varma25-Feb-04 18:07
Mahesh Varma25-Feb-04 18:07 
GeneralHandling Dialog with menu item Pin
swarnamanoo25-Feb-04 17:53
swarnamanoo25-Feb-04 17:53 
Generalcursor question Pin
ls.wang25-Feb-04 16:35
ls.wang25-Feb-04 16:35 
GeneralAMD64 and MFC Pin
Robert Buldoc25-Feb-04 15:12
Robert Buldoc25-Feb-04 15:12 
GeneralRe: AMD64 and MFC Pin
Michael Dunn25-Feb-04 15:15
sitebuilderMichael Dunn25-Feb-04 15:15 
GeneralRe: AMD64 and MFC Pin
Robert Buldoc25-Feb-04 15:16
Robert Buldoc25-Feb-04 15:16 
GeneralAccess CFormView vars from CMainFrame Pin
Daniel132425-Feb-04 12:02
Daniel132425-Feb-04 12:02 
GeneralRe: Access CFormView vars from CMainFrame Pin
ian mariano25-Feb-04 12:18
ian mariano25-Feb-04 12:18 
GeneralRe: Access CFormView vars from CMainFrame Pin
Daniel132425-Feb-04 13:10
Daniel132425-Feb-04 13:10 
GeneralRe: Access CFormView vars from CMainFrame Pin
Steve S25-Feb-04 22:47
Steve S25-Feb-04 22:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.