FindWindowWithText works by looking at "window caption" text. That is the only text that is actually "published". Text inside firefox is not caption text.
Let's put it another way. FindWindowWithText should be able to see the text that you see in the Tools->View System Windows tool. It will see the text that appears within quote marks.
You will notice that text inside a webpage does NOT appear in here.
See also:
http://msdn.microsoft.com/en-us/library ... s.85).aspx
If the target window is owned by the current process, GetWindowText causes a WM_GETTEXT message to be sent to the specified window or control. If the target window is owned by another process and has a caption, GetWindowText retrieves the window caption text. If the window does not have a caption, the return value is a null string. This behavior is by design.
In contrast - I've tried to explain this many, many, many times - the text capture fuctions GetText... install a system hook which monitors calls to TextOut (and variants):
http://msdn.microsoft.com/en-us/library ... s.85).aspx
This text isn't published - we have to snoop with a "hook" and monitor when a process calls this function.
And this still assumes that the application does actually call this function. Most standard apps usually do *even though the programmer may not be aware of it*. But some may not. Bear in mind that text is just our interpretation of a series of dots on a screen. If the application developer decided to create his own text output function by turning individual dots black using some form of graphics capability instead of telling Windows to do it using Windows own TextOut functions then as far as Windows/Macro Scheduler is concerned there is no text.
These hooks need to "listen" for a while, the text needs to be visible, and there are resource implications in calling them, so it would not be feasible to make a version of FindWindowWithText that uses these hooks - even if we did it would have to cycle through every window on the system, making it visible and making it active, one by one, in turn. That just isn't going to go down well with anyone. So realistically, we can't watch for all text using FindWindowWithText which is why it can only work with the caption text that Windows publishes.