Click here to Skip to main content
15,899,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Does Array always need to allocate memory? Pin
Stephen Hewitt6-Feb-06 12:14
Stephen Hewitt6-Feb-06 12:14 
GeneralRe: Does Array always need to allocate memory? Pin
Ming Luo6-Feb-06 12:23
Ming Luo6-Feb-06 12:23 
QuestionCString weirdness Pin
Daniel Odom6-Feb-06 11:28
Daniel Odom6-Feb-06 11:28 
AnswerRe: CString weirdness Pin
Graham Bradshaw6-Feb-06 13:23
Graham Bradshaw6-Feb-06 13:23 
AnswerRe: CString weirdness Pin
RChin6-Feb-06 13:51
RChin6-Feb-06 13:51 
AnswerRe: CString weirdness Pin
Maximilien6-Feb-06 15:01
Maximilien6-Feb-06 15:01 
QuestionNeed help with Text Edit Box control Pin
the Jimmy6-Feb-06 10:58
the Jimmy6-Feb-06 10:58 
AnswerRe: Need help with Text Edit Box control Pin
Gavin Taylor6-Feb-06 13:17
professionalGavin Taylor6-Feb-06 13:17 
Whenever the return key is hit on a dialog Windows will by default fire a WM_COMMAND event saying that the default button was clicked (usually with the id of IDOK). To override it you'll need to watch any keyboard messages received and filter them out.

To do this override the PreTranslateMessage event for the dialog using the Class Wizard and add something like:
BOOL CYourDialogClass::PreTranslateMessage( MSG* pMsg )
{
	switch( pMsg->message )
	{
		case WM_KEYDOWN:
		{
			if( pMsg->wParam == VK_RETURN )
			{
				if( pMsg->hwnd == GetDlgItem( IDC_EDIT1 )->GetSafeHwnd( ) )
				{
					// Do Processing Here!
					return TRUE;
				}
			}
		}
	}
	
	return CDialog::PreTranslateMessage(pMsg);
}


Gavin Taylor
w: http://www.gavspace.com



-- modified at 19:33 Monday 6th February, 2006
GeneralRe: Need help with Text Edit Box control Pin
Wim Engberts7-Feb-06 11:49
Wim Engberts7-Feb-06 11:49 
GeneralRe: Need help with Text Edit Box control Pin
the Jimmy7-Feb-06 17:52
the Jimmy7-Feb-06 17:52 
QuestionBest Book for Visual C++ .net? Pin
Mutty6-Feb-06 9:22
Mutty6-Feb-06 9:22 
AnswerRe: Best Book for Visual C++ .net? Pin
Christian Graus6-Feb-06 11:43
protectorChristian Graus6-Feb-06 11:43 
AnswerRe: Best Book for Visual C++ .net? Pin
mark gooding7-Feb-06 4:34
mark gooding7-Feb-06 4:34 
QuestionCompile unicode strings into VC6 project, get pointer to strings in stringtable Pin
Andre xxxxxxx6-Feb-06 8:58
Andre xxxxxxx6-Feb-06 8:58 
AnswerRe: Compile unicode strings into VC6 project, get pointer to strings in stringtable Pin
PJ Arends6-Feb-06 11:07
professionalPJ Arends6-Feb-06 11:07 
GeneralRe: Compile unicode strings into VC6 project, get pointer to strings in stringtable Pin
Andre xxxxxxx6-Feb-06 11:41
Andre xxxxxxx6-Feb-06 11:41 
QuestionReading MiniDumps Pin
Richard Andrew x646-Feb-06 8:58
professionalRichard Andrew x646-Feb-06 8:58 
Questionmultithreading problem with boost Pin
Keith Vitali6-Feb-06 8:34
Keith Vitali6-Feb-06 8:34 
AnswerRe: multithreading problem with boost Pin
Stephen Hewitt6-Feb-06 12:39
Stephen Hewitt6-Feb-06 12:39 
GeneralRe: multithreading problem with boost Pin
Keith Vitali6-Feb-06 19:25
Keith Vitali6-Feb-06 19:25 
GeneralRe: multithreading problem with boost Pin
Stephen Hewitt6-Feb-06 19:29
Stephen Hewitt6-Feb-06 19:29 
QuestionVector question Pin
RobJones6-Feb-06 7:40
RobJones6-Feb-06 7:40 
AnswerRe: Vector question Pin
Maximilien6-Feb-06 7:52
Maximilien6-Feb-06 7:52 
AnswerRe: Vector question Pin
BlackDice6-Feb-06 9:00
BlackDice6-Feb-06 9:00 
AnswerRe: Vector question Pin
Stephen Hewitt6-Feb-06 11:48
Stephen Hewitt6-Feb-06 11:48 

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.