-
EnumChildWindows Problem
I'm trying to make a program that changes the text of the Searh button on www. google.com ( to try and make a program that "interacts" with IE) but i'm having so problems :( no matter what I do it still won't work.
Code:
BOOL CALLBACK EnumAllWindows(HWND hwnd, LPARAM lparam);
int main()
{
HWND hWnd = FindWindow(NULL,"Google - Microsoft Internet Explorer");
EnumChildWindows(hWnd,EnumAllWindows,NULL);
cin.get();
}
BOOL CALLBACK EnumAllWindows(HWND hwnd, LPARAM lparam)
{
char window_name [256];
char sClassName[50];
GetClassName(hwnd,sClassName,50);
GetWindowText(hwnd,window_name,256);
cout << window_name <<endl;
return true;
}
-
Is the return value from FindWindow non-NULL? If not, what does GetLastError have to say about it? Have you tried to use something like spy++ (msvc tool; winspy is a free and simpler variation) to see if your target window/control is the same 'found' by your application?
-
I do not believe FindWindow will work since IE uses a windowless model.
-
So there is no way to do what I want to acheive? Is there another language better suited to do what I want to do? maybe C#?