use strict; use warnings; use Win32::GuiTest qw( FindWindowLike ); my @Mhnds = FindWindowLike(undef, "^Google Talk") or die "Cannot find Messenger Running"; printf "handle of Messenger is %xn", $Mhnds[0];