You can use FindWindowEx to get a child window, or EnumChildWindows.
Not sure what you mean by "main window". Any window that is not enclosed within another window (as a textbox is) can be found using FindWindow.