andyb123
19th September 2007 21:16 UTC
FindWindow Wildcard
Is it possible to search for a WindowTitle using a wildcard?
My situation is that I can't use the WindowClass and my application's window title is dynamic. However, there's always a substring of the window title that is static. If I can use a wildcard when specifying my WindowTitle when using FindWindow, it would be possible to locate my application.
andyb123
20th September 2007 15:16 UTC
That would work if I was searching by class name. But I'm not. I'm searching by window title.
Joel
20th September 2007 18:08 UTC
I think you need to play with EnumWindows, EnumChildWindows with GetWindowText and lstrcmp.
Anders
20th September 2007 21:26 UTC
You should be able to just replace the call to GetClassName with GetWindowText
Another option would be to use something like RegisterWindowMessage in your application, and send the message(with timeout) to all top level windows and look for a non 0 return in the installer (not fool proof, but neither option is)
Comm@nder21
21st September 2007 00:57 UTC
i wrote that function.
window title = class name.