I am having some problems understanding and implementing WM_GETTEXT.

I am writing an application in which I need to get the text from a RichEdit text box in another running windows application. Through research I have come to the conclusion that I need to use WM_GETTEXT, yet I am having some difficulty.

The first problem I am running into is figureing out the hwnd of the window that contains the text box that I need to pull data from. In the task manager the title is "Picnic 12945 - Play online". I also downloaded winspecter that lets me see the hwnd of the window, but I cant figure out how to find this dynamically. To add additional complexity to the problem there are multiple picnics that I could be accessing from time to time.

The second problem is if I am able to find this hwnd then I am unsure as to how to access the individual control (text box) in that window.

I have spent many hours searching forums and google for a soultion. If you could offer some help it would be greatly apprecaited.

Thank you,
-Patrick