Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

FindWindow

Posted on 1998-09-16
7
Medium Priority
?
664 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 300 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.
Suggested Courses

721 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