Don't use DTM's.. They're over suggested.. It's not the answer to everything. Not sure why anyone would use a DTM to find a window. No disrespect to the suggester above, but I wouldn't use a DTM..
function FindWindow(TitlePrefix: String): Boolean;
var
T: TSysProcArr;
I: Integer;
begin
T:= GetProcesses();
for I := 0 to high(T) do
if ExecRegExpr(TitlePrefix, T[i].Title) then //If you aren't familiar with RegExpressions, use (Pos(...) > 0)
Result := True;
end;
OR use an extension:
[PHP]
function FindWindow(ClassName, WindowName: PChar): HWND; external 'FindWindowA@User32.dll'
function FindSmart: HWND; //Returns a handle to the found window..
var
Smart: HWND;
begin
Smart:= FindWindow('SunAwtFrame', 'Public SMARTv6.9 - SMART Minimizing Autoing Resource Thing - By BenLand100');
result:= Smart;
end;
[/PHP]
For other extension stuff, view my extension here:
http://villavu.com/forum/showthread.php?t=65657