Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
AnswerRe: services in xp Pin
Archer28216-Oct-05 19:36
Archer28216-Oct-05 19:36 
QuestionDrawIconEx &amp; ILD_BLEND50 Pin
ClickHeRe16-Oct-05 11:25
ClickHeRe16-Oct-05 11:25 
GeneralRe: DrawIconEx &amp; ILD_BLEND50 Pin
Shog916-Oct-05 19:57
sitebuilderShog916-Oct-05 19:57 
GeneralRe: DrawIconEx &amp; ILD_BLEND50 Pin
ClickHeRe17-Oct-05 0:02
ClickHeRe17-Oct-05 0:02 
GeneralRe: DrawIconEx &amp; ILD_BLEND50 Pin
Shog917-Oct-05 6:32
sitebuilderShog917-Oct-05 6:32 
GeneralRe: DrawIconEx &amp; ILD_BLEND50 Pin
ClickHeRe17-Oct-05 7:09
ClickHeRe17-Oct-05 7:09 
AnswerRe: DrawIconEx & ILD_BLEND50 Pin
Shog917-Oct-05 8:38
sitebuilderShog917-Oct-05 8:38 
QuestionCResourceException Pin
LighthouseJ16-Oct-05 10:44
LighthouseJ16-Oct-05 10:44 
AnswerRe: CResourceException Pin
Anonymous16-Oct-05 15:35
Anonymous16-Oct-05 15:35 

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.