I stumbled over these two new functions in the PHP CVS today. They are only available in Windows as they use COM, but interesting non the least.
imagegrabwindow — Captures a window
resource imagegrabwindow ( int $window [, int $client_area] )
Grabs a window or its client area using a windows handle (HWND property in COM instance)
imagegrabscreen — Captures the whole screen
resource imagegrabscreen ( void )
Grabs a screenshot of the whole screen.
See the manual pages for examples.