PDA

View Full Version : FindWindow Wildcard


andyb123
19th September 2007, 20:16
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.

Anders
19th September 2007, 21:34
http://nsis.sourceforge.net/Enhanced_FindWindow_for_variable_window_class_names

andyb123
20th September 2007, 14:16
That would work if I was searching by class name. But I'm not. I'm searching by window title.

Joel
20th September 2007, 17:08
I think you need to play with EnumWindows, EnumChildWindows with GetWindowText and lstrcmp.

Anders
20th September 2007, 20:26
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
20th September 2007, 23:57
i wrote that function.

window title = class name.