> Now, getting the window title I don't know about. I was about to suggest> Win32::Console::Title, but that, I believe, is only the command window
(if
> any) that is running the current script.>> Anyone?>
I would try using Win32::API with autoitdll.dll (hiddensoft.com). I tested
the snippet below and it does the trick. (There is a more forcefull call of
WinKill if the app is not responding).
use Win32::API;
# void WINAPI AUTOIT_SetTitleMatchMode(
# int nMode
# );
my $autoit_match_mode = new Win32::API("AutoItDLL",
"AUTOIT_SetTitleMatchMode", [I], V);
# void WINAPI AUTOIT_WinClose(
# char *szTitle,
# char *szText
# );
my $autoit_close = new Win32::API("AutoItDLL", "AUTOIT_WinClose", [P,P],
V);
$autoit_match_mode->Call(1);
$autoit_close->Call("test.txt - Notepad", ""); # leaves other instances of
Notepad alone
Steve