Click here to Skip to main content
16,005,038 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Detected memory leaks! - How to get the point of memory leak and remove it Pin
GDavy9-Jun-04 2:54
GDavy9-Jun-04 2:54 
GeneralRe: Detected memory leaks! - How to get the point of memory leak and remove it Pin
Diddy9-Jun-04 3:03
Diddy9-Jun-04 3:03 
GeneralRe: Detected memory leaks! - How to get the point of memory leak and remove it Pin
GDavy9-Jun-04 2:52
GDavy9-Jun-04 2:52 
GeneralRe: Detected memory leaks! - How to get the point of memory leak and remove it Pin
JHAKAS9-Jun-04 3:08
JHAKAS9-Jun-04 3:08 
GeneralSelect text inside edit box Pin
marcomars9-Jun-04 2:22
marcomars9-Jun-04 2:22 
GeneralRe: Select text inside edit box Pin
GDavy9-Jun-04 2:56
GDavy9-Jun-04 2:56 
GeneralRe: Select text inside edit box Pin
marcomars9-Jun-04 3:23
marcomars9-Jun-04 3:23 
GeneralRe: Select text inside edit box Pin
Andrew Quinn AUS9-Jun-04 3:56
Andrew Quinn AUS9-Jun-04 3:56 
Hi Marco,

Try the PreTranslateMessage override, e.g. for an IE address bar type behaviour...

BOOL CMyDlg::PreTranslateMessage(MSG* pMsg) 
{
	BOOL bEatMe = FALSE;
	
	if (pMsg && pMsg->message == WM_LBUTTONDOWN)
	{
		CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
		// Is this our edit control?
		if (pEdit && pEdit->GetSafeHwnd() && pMsg->hwnd == pEdit->GetSafeHwnd())
		{
			// select
			CWnd* pPrevFocus = pEdit->SetFocus();
			if (pPrevFocus == pEdit)
			{
				// already got focus so normal operation
			}
			else
			{
				// first time focus, so select all
				bEatMe = TRUE;
				pEdit->SetSel(0,-1, TRUE);
			}
		}

	}

	// return if we've processed this message or want the default/system to
	return (bEatMe) ? TRUE:CDialog::PreTranslateMessage(pMsg);
}



Hope this helps,
Andy
GeneralRe: Select text inside edit box Pin
marcomars9-Jun-04 4:36
marcomars9-Jun-04 4:36 
GeneralRe: Select text inside edit box Pin
David Crow9-Jun-04 3:13
David Crow9-Jun-04 3:13 
GeneralRe: Select text inside edit box Pin
Ravi Bhavnani9-Jun-04 4:33
professionalRavi Bhavnani9-Jun-04 4:33 
QuestionConverting Integer to POSITION? Pin
sugumar9-Jun-04 2:06
sugumar9-Jun-04 2:06 
AnswerRe: Converting Integer to POSITION? Pin
Mike Dimmick9-Jun-04 2:44
Mike Dimmick9-Jun-04 2:44 
AnswerRe: Converting Integer to POSITION? Pin
Diddy9-Jun-04 3:00
Diddy9-Jun-04 3:00 
GeneralTo Pause a Thread Pin
cberam9-Jun-04 1:28
cberam9-Jun-04 1:28 
GeneralRe: To Pause a Thread Pin
jmkhael9-Jun-04 2:55
jmkhael9-Jun-04 2:55 
GeneralRe: To Pause a Thread Pin
cberam10-Jun-04 2:04
cberam10-Jun-04 2:04 
GeneralRe: To Pause a Thread Pin
palbano9-Jun-04 5:57
palbano9-Jun-04 5:57 
GeneralRe: To Pause a Thread Pin
cberam10-Jun-04 2:04
cberam10-Jun-04 2:04 
Generaldisplaying window on checking password Pin
Anonymous9-Jun-04 1:10
Anonymous9-Jun-04 1:10 
GeneralRe: displaying window on checking password Pin
Diddy9-Jun-04 1:54
Diddy9-Jun-04 1:54 
GeneralRe: displaying window on checking password Pin
David Crow9-Jun-04 3:18
David Crow9-Jun-04 3:18 
Generalproblem with PreTranslateMsg and Tab Order Pin
YaronNir8-Jun-04 23:37
YaronNir8-Jun-04 23:37 
GeneralRe: problem with PreTranslateMsg and Tab Order Pin
YaronNir8-Jun-04 23:53
YaronNir8-Jun-04 23:53 
Generalpbs with DLLs... Pin
JRacle8-Jun-04 23:28
JRacle8-Jun-04 23:28 

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.