Wow. “Windows” is a pretty broad topic! (The purpose of the subject line is to attract those who are interested in the realm of your problem...)
Another tip (if I may): It would be better to use normal capitalization in posts (“VB
” not “vb
,” “I'm” not “i'm,” etc.) It makes your posts easier to read, allowing more focus on what
you’re saying, without having to surmount how
you’re saying it.
There is an API, something like “EnumerateWindows” which gives you all of the windows that are open, tat is, that exist. (BTW: There’s never more than 1 active window...)
Having obtained the windows (you receive the contents of their title bar), you can then use the method of adding lines to a listbox with those data.