One note with this.. The "FindWindow" API, which seems to be what he is using (just a guess, since I haven't looked at the code, but used the same for one of my tests), has a problem. It cannot tell the difference between different program windows with the same name and bigger issues arise when trying to deal with a window that changes its name, such as Mushclient does, when you open a new world (its looking at the Title bar for the name, since MS wasn't bright enough to make a "name" field or require that such a filed have a unique name for every program/process.
The safest solution *if* you could manage it, is to do something more complicated, you need to either find the window after creation (poor, but possibly the only solution), then remember that windows ID from then on (or) you would need to run the application with an API call that returns the unique process ID that Windows gives it when it starts, then remember that, so you can find the window when you need it again. Otherwise, the only "safe" solution is to only use it with programs that will not allow you to run more than one copy of themselves at one time, so you can't have a name conflict.
Anyway, nice utility. Its useful, but people should be aware that there are programs that it is "not" reliable to use it with, such as, for example, if you tried to use it with Internet Explorer and had 'several' such windows open. Unless you can identify what window you opened when you ran the program and remember it, you are relying on an API call that has no real idea what you are looking for, so might "find" and "bring to front" the wrong window. |