Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAdding a reference to MFC Project.... Pin
AmbiguousName1-Jan-11 8:09
AmbiguousName1-Jan-11 8:09 
QuestionHow can I initialize an CListBox& null reference ? Pin
mesajflaviu1-Jan-11 4:57
mesajflaviu1-Jan-11 4:57 
AnswerRe: How can I initialize an CListBox& null reference ? Pin
BicycleTheif1-Jan-11 5:28
BicycleTheif1-Jan-11 5:28 
GeneralRe: How can I initialize an CListBox& null reference ? Pin
mesajflaviu1-Jan-11 5:32
mesajflaviu1-Jan-11 5:32 
GeneralRe: How can I initialize an CListBox& null reference ? Pin
«_Superman_»1-Jan-11 7:41
professional«_Superman_»1-Jan-11 7:41 
AnswerRe: How can I initialize an CListBox& null reference ? Pin
CPallini1-Jan-11 7:54
mveCPallini1-Jan-11 7:54 
AnswerRe: How can I initialize an CListBox& null reference ? Pin
bleedingfingers2-Jan-11 20:08
bleedingfingers2-Jan-11 20:08 
QuestionHow can send message to an notepad ? [modified] Pin
mesajflaviu1-Jan-11 2:53
mesajflaviu1-Jan-11 2:53 
I open an notepad application :
void CTestMessageView::OnHelpStartapplication() 
{
	// TODO: Add your command handler code here

	ShellExecute(m_hWnd,"open","notepad.exe",NULL,NULL,SW_SHOWNORMAL);
}

and I want to send some message to notepad :

void CTestMessageView::OnHelpSendmessage() 
{
	// TODO: Add your command handler code here

	CString sTemp = "Test message\n";

	HWND hWnd = ::FindWindow("Notepad",NULL);
	if(hWnd)
	{
//		::PostMessage(hWnd,WM_CLOSE,0,0);
		::PostMessage(hWnd,WM_CHAR,(WPARAM)'1',0);
		::PostMessage(hWnd,WM_KEYDOWN,'1',0);
		::PostMessage(hWnd,WM_SETTEXT,0,(LPARAM)(LPCTSTR)sTemp);
		::PostMessage(hWnd,EM_REPLACESEL,0,(LPARAM)(LPCTSTR)sTemp);
	}
}


but only first message WM_CLOSE ( comment one ) is receipt by notepad , other , not . I think that other message then WM_CLOSE is addressed for view of notepad , not the main frame window of the notepad . My question is , how can I send message to the view , not the main frame window of notepad ?

modified on Saturday, January 1, 2011 9:13 AM

AnswerRe: How can send message to an notepad ? Pin
Espen Harlinn1-Jan-11 4:43
professionalEspen Harlinn1-Jan-11 4:43 
AnswerRe: How can send message to an notepad ? Pin
«_Superman_»1-Jan-11 7:54
professional«_Superman_»1-Jan-11 7:54 
GeneralRe: How can send message to an notepad ? Pin
normanS1-Jan-11 14:32
normanS1-Jan-11 14:32 
AnswerRe: How can send message to an notepad ? Pin
Luc Pattyn1-Jan-11 16:15
sitebuilderLuc Pattyn1-Jan-11 16:15 
Question891011 - nested groups in a property grid Pin
ilostmyid231-Dec-10 22:48
professionalilostmyid231-Dec-10 22:48 
QuestionWhy is index in document gone? [modified] Pin
followait31-Dec-10 16:59
followait31-Dec-10 16:59 
AnswerRe: Why is index in document gone? Pin
Richard MacCutchan1-Jan-11 0:41
mveRichard MacCutchan1-Jan-11 0:41 
GeneralRe: Why is index in document gone? [modified] Pin
followait1-Jan-11 5:47
followait1-Jan-11 5:47 
QuestionWhy the first parameter of CreateEvent () method is NULL Pin
pandit8431-Dec-10 0:02
pandit8431-Dec-10 0:02 
AnswerRe: Why the first parameter of CreateEvent () method is NULL Pin
jk chan31-Dec-10 1:09
jk chan31-Dec-10 1:09 
GeneralRe: Why the first parameter of CreateEvent () method is NULL Pin
pandit8431-Dec-10 2:14
pandit8431-Dec-10 2:14 
GeneralRe: Why the first parameter of CreateEvent () method is NULL Pin
«_Superman_»31-Dec-10 4:54
professional«_Superman_»31-Dec-10 4:54 
GeneralRe: Why the first parameter of CreateEvent () method is NULL Pin
fat_boy31-Dec-10 4:54
fat_boy31-Dec-10 4:54 
GeneralRe: Why the first parameter of CreateEvent () method is NULL Pin
bleedingfingers2-Jan-11 20:12
bleedingfingers2-Jan-11 20:12 
GeneralRe: Why the first parameter of CreateEvent () method is NULL Pin
pandit842-Jan-11 22:30
pandit842-Jan-11 22:30 
GeneralRe: Why the first parameter of CreateEvent () method is NULL Pin
bleedingfingers2-Jan-11 22:37
bleedingfingers2-Jan-11 22:37 
GeneralRe: Why the first parameter of CreateEvent () method is NULL Pin
pandit842-Jan-11 23:30
pandit842-Jan-11 23:30 

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.