How do I get a windows title text?

I need to get the titles of all windows open.
Or I need to get just the title of the IE window how do I do that?
Who is Participating?
davepcam1Connect With a Mentor Commented:
Hi there,
All you need to do is stick this in a module

Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

and you call it as if you were getting a property,

its simmilar to the APPACTIVATE command in VB
 Hi. You need to use API programming.

  Take a look at:,

  Good luck!
If you want to find the handles to Internet Explorer Windows then you could try using FindWindow API which has 2 parameters Classname and window caption

Classname for Internet Explorer is IEFrame

if you know both parameters then its findWindow("IEFrame","MyCaption")

else if you only know one then you can use it in this fashion

FindWindow("IEFrame", 0&) or FindWindow(0&,"Mycaption")

0& is null terminated string
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.