Thread: EnumChildWindows Problem

  1. #1
    Banned
    Join Date
    Oct 2004
    Posts
    250

    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;
    }

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    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?
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    I do not believe FindWindow will work since IE uses a windowless model.

  4. #4
    Banned
    Join Date
    Oct 2004
    Posts
    250
    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#?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM