Click here to Skip to main content
15,916,702 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhelp! why the compiler kept modifying my source file? Pin
ewighell16-Oct-05 19:29
ewighell16-Oct-05 19:29 
AnswerRe: help! why the compiler kept modifying my source file? Pin
Rage16-Oct-05 23:39
professionalRage16-Oct-05 23:39 
GeneralRe: help! why the compiler kept modifying my source file? Pin
ewighell17-Oct-05 1:00
ewighell17-Oct-05 1:00 
QuestionHow to find data encoding of received buffer with WSARecv Pin
Member 168985516-Oct-05 19:00
Member 168985516-Oct-05 19:00 
AnswerRe: How to find data encoding of received buffer with WSARecv Pin
ThatsAlok16-Oct-05 21:43
ThatsAlok16-Oct-05 21:43 
Questionunable to get all Messages from Clients using IOCP Pin
Member 168985516-Oct-05 18:58
Member 168985516-Oct-05 18:58 
QuestionC++ Serial Loopback port converting to char, where can I correct this Pin
ianfinlay_tyco16-Oct-05 18:19
ianfinlay_tyco16-Oct-05 18:19 
AnswerRe: C++ Serial Loopback port converting to char, where can I correct this Pin
stewartl17-Oct-05 0:11
stewartl17-Oct-05 0:11 
GeneralRe: C++ Serial Loopback port converting to char, where can I correct this Pin
ianfinlay_tyco18-Oct-05 12:53
ianfinlay_tyco18-Oct-05 12:53 
QuestionI have an error Pin
vhazell16-Oct-05 16:33
vhazell16-Oct-05 16:33 
AnswerRe: I have an error Pin
GflPower16-Oct-05 17:07
GflPower16-Oct-05 17:07 
GeneralRe: I have an error Pin
vhazell16-Oct-05 17:28
vhazell16-Oct-05 17:28 
AnswerRe: I have an error Pin
P-Rex16-Oct-05 21:32
P-Rex16-Oct-05 21:32 
GeneralRe: I have an error Pin
vhazell16-Oct-05 21:44
vhazell16-Oct-05 21:44 
GeneralRe: I have an error Pin
P-Rex16-Oct-05 22:07
P-Rex16-Oct-05 22:07 
GeneralRe: I have an error Pin
David Crow17-Oct-05 2:47
David Crow17-Oct-05 2:47 
Questionretrieve MSN messenger conversations Pin
smargada16-Oct-05 14:33
smargada16-Oct-05 14:33 
Hi, i'm new around and i have a big problem. i have to make a program to log msn conversations into .txt files and i'm having trouble doing it. this is going to be my final college project so i need it to work before december

i found an article here in code project on how to retrieve conversations based on the windows title, i already fixed the code like this to get all the windows titles an display a textbox when it founds a conversation window. right now i'm sending all the windows names to a list box while i develop the whole app

<br />
OnInitDialog(){<br />
...<br />
EnumWindows(EnumWindowCallBack, (LPARAM)::GetDlgItem(m_hWnd, IDC_LIST_RUNNING));<br />
...<br />
}


static BOOL CALLBACK EnumWindowCallBack(HWND hwnd, LPARAM lParam) <br />
{ <br />
	HWND hWnd = (HWND)lParam; <br />
	CString strTitle;<br />
	DWORD wndPid;<br />
<br />
	if (IsWindowVisible(hwnd))<br />
	{<br />
		GetWindowThreadProcessId(hwnd, &wndPid);<br />
		CWnd::FromHandle(hwnd)->GetWindowText(strTitle);<br />
		strTitle.TrimRight();<br />
		if (!strTitle.IsEmpty())<br />
		{<br />
			CListBox *pListBox = (CListBox *)CWnd::FromHandle(hWnd);<br />
			pListBox->AddString(strTitle);<br />
			if((strTitle.Find("- Conversation",0))!=-1){<br />
				::MessageBox(hWnd,"Found","MSN",MB_OK);<br />
				EnumChildWindows(hWnd, ChildWndProc,0);<br />
			}<br />
		}<br />
	}<br />
<br />
	// Keep enumerating <br />
	return TRUE; <br />
}


the function that it's supposed to retrieve the text from the conversation windows is
<br />
static BOOL CALLBACK ChildWndProc(HWND hwnd, LPARAM lParam){<br />
	static int i = 0;<br />
	LPTSTR lptstr;<br />
	HGLOBAL hglb;<br />
	char windowclass[CLASS_SIZE];<br />
<br />
	if(GetClassName(hwnd,windowclass,CLASS_SIZE)==0)<br />
		return TRUE;<br />
<br />
	string strTemp(windowclass);<br />
	if((strTemp==string("RichEdit20W")) || (strTemp==string("RichEdit20A"))){<br />
		::SendMessage(hwnd,EM_SETSEL,0,-1); //start selecting<br />
		::SendMessage(hwnd,WM_COPY,0,0);<br />
		::SendMessage(hwnd,EM_SETSEL,-1,0); //end selecting<br />
<br />
		if (!IsClipboardFormatAvailable(CF_TEXT)) <br />
			return TRUE; <br />
<br />
		if (! ::OpenClipboard(NULL)) <br />
			return TRUE; <br />
<br />
		hglb = GetClipboardData(CF_TEXT); <br />
		if (hglb != NULL) <br />
		{<br />
			lptstr = (LPTSTR)GlobalLock(hglb); <br />
			GlobalUnlock(hglb); <br />
			EmptyClipboard();<br />
			CloseClipboard();<br />
			::MessageBox(hwnd,lptstr,"MSN",MB_OK);<br />
			pChatText->SetWindowText(lptstr);<br />
			<br />
			return FALSE;<br />
		}<br />
	}<br />
	return TRUE;<br />
}


when i compile and run the program i don't get any errors or warnings but it doesn't retrieve any conversation.

i just can't figure out what's wrong or if this code just doesn't do the work.

i'm using Visual C++ 6.0 SP6 on W2K and MSN messenger 7.0.0813 to do this app

could somebody tell me what's wrong with that code in order to do the rest of the app or tell me if there's another way to retrieve msn conversations?

any help is really appreciated
AnswerRe: retrieve MSN messenger conversations Pin
ThatsAlok16-Oct-05 19:05
ThatsAlok16-Oct-05 19:05 
QuestionRe: retrieve MSN messenger conversations Pin
David Crow17-Oct-05 8:02
David Crow17-Oct-05 8:02 
AnswerRe: retrieve MSN messenger conversations Pin
ThatsAlok17-Oct-05 18:02
ThatsAlok17-Oct-05 18:02 
Questionservices in xp Pin
Archer28216-Oct-05 13:25
Archer28216-Oct-05 13:25 
AnswerRe: services in xp Pin
GflPower16-Oct-05 17:11
GflPower16-Oct-05 17:11 
GeneralRe: services in xp Pin
Archer28216-Oct-05 17:16
Archer28216-Oct-05 17:16 
GeneralRe: services in xp Pin
l a u r e n16-Oct-05 18:46
l a u r e n16-Oct-05 18:46 
GeneralRe: services in xp Pin
ThatsAlok16-Oct-05 18:57
ThatsAlok16-Oct-05 18:57 

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.