Using the "FindWindow" function from the User32.dll

in my prog. , i'm trying to find in run time whether the microsoft word is running already or not, by using the "FindWindow" function from the user32.dll API.
my question is :when i use this function (FindWindow), i must insert as argument the window name i would like the function to search for.
does anynoe know the name of microsoft word, in order the function will tell me if it's already running or not.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Take a look here, it will solve your problem :

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The name of the window is the text written in the blue title bar at the top of the window.

Note: the full title of the window may change depending on what file you have open.

Ie: Untitled - Notepad may become Myfile - Notepad where MyFile is the name of the file you have open.


Doh, Waty answered while I was writing this, oh well. Guess I'll have to learn to type faster :)
May as well post it as a comment, although I'm sure waty's answer will be correct.
Both our answer are correct stewfidgeon, mine is a link to an explanation on how to do the work.

Anyway, here is another link :

"How do I find out if a particular program is running when I don't know the entire window caption?" Ever asked that question? Then this demo Is For you! Provides a custom FindWindowPartial Function that returns the handle of the first window that matches your search criteria. You can search For window captions that start With, Or contain, any substring you wish. Perfect For apps that show both their own Name And the Name of the active document In the titlebar.

Some of the APIs used include EnumWindows, FindWindow, GetWindow, GetWindowText, IsIconic, SetForegroundWindow, ShowWindow And more.

Featured In my Programming Techniques column, VBPJ, September 1995
And Ask the VB Pro column, VBPJ, June 1998.
Provided As VB4-16/32 conditionally-compiled source, And VB5 32-bit.    (7K) :

NB : I use my VBCodeDatabase to respond, it contains lots of useful knowledge, and I can respond to almost arround 60% of questions easily using this :)

Take a look to my web for a shareware version :)

This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.
Thank you,
Moderator @ Experts Exchange
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.