
It should be easily extended to cope with other resolutions, though.
9900 SCREEN GRABBER COD CODE
Memcpy(pBuffer + sizeof(DIBINFO), dib.GetDIBits(), dib.GetImageSize()) Īs you can see, this code is limited to 16 bit pixels and portrait orientation.

Memcpy(pBuffer, dib.GetBitmapInfo(), sizeof(DIBINFO)) PBuffer = (BYTE*)LocalAlloc(LPTR, dwSize) The screen capture process starts by retrieving the physical screen coordinates:ĭwSize = sizeof(DIBINFO) + dib.GetImageSize() The sample code uses a class named CGC to encapsulate all the GAPI function calls (it was originally developed for another article ). GAPI Screen CaptureĬapturing the screen with GAPI involves getting the address of the screen's frame buffer and converting it to a GDI bitmap (a DIB section). The sample code includes compiled versions for Pocket PC 2002, 2003, Windows Mobile 5 (Pocket PC and SmartPhone), and Windows Mobile 6 Professional.ĭepending on the target device platform, the device screen contents are captured using GAPI for Windows CE 3.0 and 4.2, and Direct Draw for later versions. The screen capturing component is implemented as a RAPI extension DLL, and deployed on the target device, typically in the \Windows folder. The result, although clearly not complete, does illustrate two possible approaches, and provides you with a free RAPI-based tool for your screen capture sessions. Using some of my weekend's idle time, I decided to have a go at this problem when my internet searches turned up nothing. BackgroundĬapturing the device screen contents has always been a mystery to me. A sample desktop application is provided to display the captured bitmap and to copy the bitmap to the Clipboard so it can be used in other applications.

Depending on the target platform, the device screen is captured using either GAPI or DirectDraw. This article describes the implementation of a remote Windows Mobile screen grabber.
