... use Tk; use Win32::API; # Windows constants my ($OnTop, $NoTop, $Top) = (-1, -2, 0); my ($SWP_NOMOVE, $SWP_NOSIZE) = (2, 1); ... # Create a Win32::API object for SetWindowPos my $SetWindowPos = new Win32::API("user32", "SetWindowPos", [N,N,N,N,N,N,N], N); ... my $w = new MainWindow; ... # do the 'always on top' bit my $hwnd = $w->frame; # frame returns a hex value as a string, e.g. "0x1234" print "$hwnd\n"; $SetWindowPos->Call(hex($hwnd), $OnTop, 0, 0, 0, 0, $SWP_NOMOVE | $SWP_NOSIZE); MainLoop;