Solved

FindWindow

Posted on 1998-09-16
7
662 Views
Last Modified: 2012-06-22
The FindWindow function(Win32 API) does not find a window if the name is not one word.
FindWindow(NULL, "Calculator") - no problem
FindWindow(NULL, "My Program") - problem
What could be the problem
Thank You
0
Comment
Question by:ibs22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 11

Accepted Solution

by:
alexo earned 100 total points
ID: 1172882
It works perfectly OK.  Start regedit.exe and try FindWindow(NULL, "Registry Editor")

Possible reasons for your problem:

* The title contains other blank or non-printable characters.  Check with Spy++ or a similar tool.

* The letter case is incorrect.  The matching is case-sensitive!

* Your window is not a top-level window.  Check with Spy++ or a similar tool.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1172883
Another posibility is that the blank is more than one space in a row (or more than one non-printable character).  
0
 

Author Comment

by:ibs22
ID: 1172884
The title of the window I am trying to find is
Engineering Work Station(EWS)
When you mentioned the title contains other blanks, would the second blank in the title  cause a problem.

It is a top-level window.
Thank You
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:nietod
ID: 1172885
No.  All that matters is that your search string matches the string in the title exactly.  For example, If you put a space before the "(EWS)" and they don't, you won't find it.
0
 
LVL 11

Expert Comment

by:alexo
ID: 1172886
I see you have accepted my answer.  Does it mean that the solution was correct?  What was the problem?
0
 

Author Comment

by:ibs22
ID: 1172887
I was missing a space and I was also trying to use the FindWindow function for a console.
Thank You

0
 
LVL 11

Expert Comment

by:alexo
ID: 1172888
Have fun!
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question