Click here to Skip to main content
15,914,416 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to get data from clipboard Pin
Max++27-Dec-06 18:58
Max++27-Dec-06 18:58 
AnswerRe: How to get data from clipboard Pin
_AnsHUMAN_ 27-Dec-06 19:05
_AnsHUMAN_ 27-Dec-06 19:05 
AnswerRe: How to get data from clipboard Pin
prasad_som27-Dec-06 19:09
prasad_som27-Dec-06 19:09 
QuestionDirectshow custom filter linking problem Pin
godspeed12327-Dec-06 18:47
godspeed12327-Dec-06 18:47 
AnswerRe: Directshow custom filter linking problem Pin
Mark Salsbery28-Dec-06 5:54
Mark Salsbery28-Dec-06 5:54 
QuestionHiding the ListCtrl item Pin
Taruni27-Dec-06 18:42
Taruni27-Dec-06 18:42 
AnswerRe: Hiding the ListCtrl item Pin
ThatsAlok27-Dec-06 22:17
ThatsAlok27-Dec-06 22:17 
Questionif statement help Pin
dellthinker27-Dec-06 18:33
dellthinker27-Dec-06 18:33 
Hi all, i created a function that retrieves the url from the address bar in IE, however it needs work. If i place the SendMessage function in a if statement it returns a bunch of useless garbage. But if i take away the if statement it works like a charm, and grabs everything that i dont want. I'd just like to filter out everything else and just retrive the http: strings.

My code:

<br />
#include <windows.h><br />
#include <stdio.h><br />
#include <fstream><br />
using namespace std;<br />
int main()<br />
{<br />
	HWND handle=FindWindow("IEFrame",0);<br />
    HWND handle2=FindWindowEx(handle, 0, "WorkerW",0);<br />
    HWND handle3=FindWindowEx(handle2, 0, "ReBarWindow32", 0);<br />
    HWND handle4=FindWindowEx(handle3,0,"Address Band Root",0);<br />
    HWND handle5=FindWindowEx(handle4,0,"ComboBoxEx32",0);<br />
   	HWND handle6=FindWindowEx(handle5,0,"ComboBox",0);<br />
    HWND handle7=FindWindowEx(handle6,0,"Edit",0);<br />
    char addy[MAX_PATH];<br />
	if(strstr(addy,"http:")!=NULL)<br />
	{<br />
		SendMessage(handle7,WM_GETTEXT,MAX_PATH,(LPARAM)(LPCSTR)addy);<br />
<br />
	}<br />
	ofstream out;<br />
	out.open("huh.txt",ios::app);<br />
	out << addy << endl;<br />
	out.close();<br />
	return 0;<br />
}<br />


This code compiles fine under VC++ so anyone can test it to see what im talking about. What do i need to do to fix this problem? Maybe send the message to another function or something? Any help would be greatly appreciated. Thanx in advance!
AnswerRe: if statement help Pin
prasad_som27-Dec-06 18:45
prasad_som27-Dec-06 18:45 
GeneralRe: if statement help Pin
dellthinker27-Dec-06 19:00
dellthinker27-Dec-06 19:00 
AnswerRe: if statement help Pin
prasad_som27-Dec-06 19:04
prasad_som27-Dec-06 19:04 
GeneralRe: if statement help Pin
dellthinker27-Dec-06 19:15
dellthinker27-Dec-06 19:15 
AnswerRe: if statement help Pin
Michael Dunn27-Dec-06 19:29
sitebuilderMichael Dunn27-Dec-06 19:29 
QuestionRunning exe problem Pin
aaaan27-Dec-06 18:13
aaaan27-Dec-06 18:13 
GeneralRe: Running exe problem Pin
prasad_som27-Dec-06 18:21
prasad_som27-Dec-06 18:21 
GeneralRe: Running exe problem Pin
aaaan27-Dec-06 18:29
aaaan27-Dec-06 18:29 
AnswerRe: Running exe problem Pin
prasad_som27-Dec-06 18:36
prasad_som27-Dec-06 18:36 
QuestionQuestion is for prasad_som Pin
amitmistry_petlad 27-Dec-06 17:29
amitmistry_petlad 27-Dec-06 17:29 
GeneralRe: Question is for prasad_som Pin
prasad_som27-Dec-06 17:38
prasad_som27-Dec-06 17:38 
AnswerRe: Question is for prasad_som Pin
Hamid_RT27-Dec-06 18:14
Hamid_RT27-Dec-06 18:14 
GeneralRe: Question is for prasad_som Pin
amitmistry_petlad 27-Dec-06 20:38
amitmistry_petlad 27-Dec-06 20:38 
QuestionRe: Question is for prasad_som Pin
prasad_som27-Dec-06 21:54
prasad_som27-Dec-06 21:54 
AnswerRe: Question is for prasad_som Pin
amitmistry_petlad 27-Dec-06 22:06
amitmistry_petlad 27-Dec-06 22:06 
AnswerRe: Question is for prasad_som Pin
prasad_som27-Dec-06 22:12
prasad_som27-Dec-06 22:12 
GeneralRe: Question is for prasad_som Pin
amitmistry_petlad 27-Dec-06 22:44
amitmistry_petlad 27-Dec-06 22:44 

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.