I am looking for a way to get the title of the window currently in focus. I should know how to do this but I've been coding forever and it's late.

I hope someone can help, thanks