kieranbarnes Independent PHP, WordPress & CubeCart Programmer

imagegrabwindow() and imagegrabscreen()

Posted on July 13, 2007

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.

Update: Pierre discusses it on his blog aswell.


Related posts

  1. Idiot Proof Lightbox
    I've just made some modifications to my Gallery code which is part of i9000's small...
  2. Upgrading from SQL 2000 to 2005 Error -1
    Ever had your Upgrade Advisor return an error while upgrading an instance of SQL Server...
  3. MySQL Tuning Server Parameters
    These are some of the handy MySQL 5.0 tweaks I do to get the most...
  4. Synchronizing time on a Windows 2003 domain controller
    In a Windows domain environment its incredibly important that all clients & servers share the...
  5. Problems installing System Center Essentials 2010
    So, I spent 16 irreplaceable hours of my life trying to install System Center Essentials...

Comments (3) Trackbacks (0)
  1. Hi!

    The functions do not use COM, only my examples as it is one of the only way to actually control an application on Windows from a standard PHP install :-)

    The functions use the win32 API to fetch the bitmap of a given window or screen.

  2. imagegrabwindow uses COM

  3. That is correct! Well done!


Leave a comment

(required)

No trackbacks yet.