in reply to capture what's on the screen

As is, this captures a bitmap of the whole screen. Use "%{PrtScn}" for just the current window. Interpreting and manipulating the bitmap captured is over to you. You may find this document useful. The site's pretty damn useful too. Qudos to PodMaster for a reference to that some time back.

#! perl -slw #use Win32::Bitmap; use strict; use Win32::GuiTest qw[SendKeys]; use Win32::Clipboard; my $cb = Win32::Clipboard->new(); $cb->Empty(); SendKeys( "+{PRTSCR}" ); $cb->WaitForChange(); my $image = $cb->GetBitmap() or die 'No bitmap there'; print 'Total size:', length $image; my %BMPinfo; @BMPinfo{ ( '01UINT type', #! 2 '02DWORD size', #! 4 '03UINT Reserved1', #! 2 '04UINT Reserved2', #! 2 '05DWORD Offset', #! 4 '06DWORD biSize', #! 4 '07LONG biWidth', #! 4 '08LONG biHeight', #! 4 '09WORD biPlanes', #! 2 '10WORD biBitCount', #! 2 '11DWORD biCompression', #! 4 '12DWORD biSizeImage', #! 4 '13LONG biXPelsPerMeter', #! 4 '14LONG biYPelsPerMeter', #! 4 '15DWORD biClrUsed', #! 4 '16DWORD biClrImportant', #! 4 ) #!54 } = unpack 'A2 L S S L L V V s s L L V V L L', substr $image, 0, 54; printf '%23s : %s'.$/, $_, $BMPinfo{$_} for sort keys %BMPinfo; __END__ C:\test>231894 Total size:1572918 01UINT type : BM 02DWORD size : 1572918 03UINT Reserved1 : 0 04UINT Reserved2 : 0 05DWORD Offset : 54 06DWORD biSize : 40 07LONG biWidth : 1024 08LONG biHeight : 768 09WORD biPlanes : 1 10WORD biBitCount : 16 11DWORD biCompression : 3 12DWORD biSizeImage : 1572864 13LONG biXPelsPerMeter : 0 14LONG biYPelsPerMeter : 0 15DWORD biClrUsed : 0 16DWORD biClrImportant : 0

Examine what is said, not who speaks.

The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.