use Win32::GUI; use Win32::API; use constant WM_COPYDATA => 74; use warnings; my $rushhandle = Win32::GUI::FindWindow("tfmrush", ""); die "Could not find Rush\n" if not $rushhandle; my $command = "RushApp.FTP.Login('backup','',0);"; my $copy_data_struct = pack( 'L2P', 1000, length( $command ) + 5, $command ); Win32::GUI::SendMessage($rushhandle, WM_COPYDATA, 0, $copy_data_struct);