Get hWnd & Title from title-changing program

LordSkitch
LordSkitch used Ask the Experts™
on
I'm sure this is a crap question to ask, but how do I get the title and hWnd from a program who's title changes at times? Say right now, the programs title is Spoot, but when someones logged on to Spoot, the title would be Spoot - SpootyUser, now how would I grab Spoot's hWnd, and the title?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You can start with the EnumWindows API function then trickle down until you can get the Window Title.  Search the window title to you get what you want:

Here's a sample.  It shows all windows to the immediate (debug) window.  You can trap until the title contains "Spoot".  However, you may have more than one "spoot" unless you stop it yourself, so be wary.


http://www.geocities.com/SiliconValley/Lab/1632/atch10.html

Author

Commented:
Wow, that worked great, thanks =)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial