ibs22
asked on
FindWindow
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
FindWindow(NULL, "Calculator") - no problem
FindWindow(NULL, "My Program") - problem
What could be the problem
Thank You
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Another posibility is that the blank is more than one space in a row (or more than one non-printable character).
ASKER
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
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
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.
I see you have accepted my answer. Does it mean that the solution was correct? What was the problem?
ASKER
I was missing a space and I was also trying to use the FindWindow function for a console.
Thank You
Thank You
Have fun!