Click here to Skip to main content
15,909,530 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A Question about Input Fields Pin
Code-o-mat29-Nov-08 22:29
Code-o-mat29-Nov-08 22:29 
GeneralRe: A Question about Input Fields Pin
BobInNJ30-Nov-08 13:43
BobInNJ30-Nov-08 13:43 
GeneralRe: A Question about Input Fields Pin
Code-o-mat30-Nov-08 21:30
Code-o-mat30-Nov-08 21:30 
GeneralRe: A Question about Input Fields Pin
BobInNJ1-Dec-08 5:55
BobInNJ1-Dec-08 5:55 
GeneralRe: A Question about Input Fields Pin
Code-o-mat1-Dec-08 7:02
Code-o-mat1-Dec-08 7:02 
GeneralRe: A Question about Input Fields Pin
BobInNJ1-Dec-08 9:35
BobInNJ1-Dec-08 9:35 
GeneralRe: A Question about Input Fields Pin
BobInNJ1-Dec-08 9:59
BobInNJ1-Dec-08 9:59 
GeneralRe: A Question about Input Fields Pin
Code-o-mat1-Dec-08 11:14
Code-o-mat1-Dec-08 11:14 
How about catching the enter keyhit and changing it to a TAB hit or maybe posting a tab hit? For example in that PreTranslateMessage you made you could try something like:

BOOL CMainWindow::PreTranslateMessage( MSG *pMsg )
{
  if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) pMsg->wParam = VK_TAB;
  return ::IsDialogMessage( m_hWnd, pMsg );
}


or maybe

BOOL CMainWindow::PreTranslateMessage( MSG *pMsg )
{
  if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN)
  {
    PostMessage(WM_KEYDOWN, VK_TAB, 0);
    return TRUE;
  } else return ::IsDialogMessage( m_hWnd, pMsg );
}


You probably need to experiment with that some, maybe you need WM_CHAR instead of WM_KEYDOWN and maybe you need also WM_KEYUP for the WM_KEYDOWN. For your second point, you can use the WM_KILLFOCUS message or notifications from the controls sent upon loosing the focus (like EN_KILLFOCUS for edits), but i don't much recommend doing that, validating on kill focus can lead to nasty results, there are articles out there about it though, try googling for them.

> The problem with computers is that they do what you tell them to do and not what you want them to do. <

GeneralRe: A Question about Input Fields Pin
BobInNJ1-Dec-08 12:59
BobInNJ1-Dec-08 12:59 
GeneralRe: A Question about Input Fields Pin
Code-o-mat1-Dec-08 21:24
Code-o-mat1-Dec-08 21:24 
GeneralRe: A Question about Input Fields Pin
BobInNJ2-Dec-08 5:47
BobInNJ2-Dec-08 5:47 
GeneralRe: A Question about Input Fields Pin
Code-o-mat2-Dec-08 6:25
Code-o-mat2-Dec-08 6:25 
QuestionHow to Update IOlkAccount Properties of Outlook Account Management API Pin
sanjaykumar982681535329-Nov-08 5:22
sanjaykumar982681535329-Nov-08 5:22 
QuestionUI for embedded device connected to computer via com port. Pin
Karmendra Suthar29-Nov-08 3:42
Karmendra Suthar29-Nov-08 3:42 
AnswerRe: UI for embedded device connected to computer via com port. Pin
BobInNJ29-Nov-08 14:03
BobInNJ29-Nov-08 14:03 
GeneralRe: UI for embedded device connected to computer via com port. Pin
Karmendra Suthar29-Nov-08 19:01
Karmendra Suthar29-Nov-08 19:01 
GeneralRe: UI for embedded device connected to computer via com port. Pin
BobInNJ30-Nov-08 13:29
BobInNJ30-Nov-08 13:29 
QuestionHow can I realize which item of a menu, THROUGH OUT the system is pressed? Pin
Joseph Marzbani29-Nov-08 3:26
Joseph Marzbani29-Nov-08 3:26 
QuestionRe: How can I realize which item of a menu, THROUGH OUT the system is pressed? Pin
sashoalm29-Nov-08 4:52
sashoalm29-Nov-08 4:52 
AnswerRe: How can I realize which item of a menu, THROUGH OUT the system is pressed? Pin
Mark Salsbery29-Nov-08 7:12
Mark Salsbery29-Nov-08 7:12 
QuestionPretranslate Message Pin
bhanu_850928-Nov-08 23:32
bhanu_850928-Nov-08 23:32 
AnswerRe: Pretranslate Message Pin
Hans Dietrich1-Dec-08 0:01
mentorHans Dietrich1-Dec-08 0:01 
QuestionXml parsing using c++ Pin
kumarsumitra28-Nov-08 23:21
kumarsumitra28-Nov-08 23:21 
AnswerRe: Xml parsing using c++ Pin
Garth J Lancaster28-Nov-08 23:30
professionalGarth J Lancaster28-Nov-08 23:30 
AnswerRe: Xml parsing using c++ Pin
Rolf Kristensen29-Nov-08 5:52
Rolf Kristensen29-Nov-08 5:52 

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.