A Simple screen capture example using windows handle and BitBlt.
This mechanism works for both GDI and DirectX window mode.
However, this screen capture has its own weakness, low performance and
abnormal mouse behaviour. Use it just as reference.
// Functions for captureing WoW screen.
//
HWND getWoWWindowHandle(void)
{
HWND wowWnd;
//return GetDesktopWindow();
// Try to find WoW window handle.
//
wowWnd = FindWindow(TEXT("GxWindowClass"), TEXT("월드 오브 워크래프트"));
if( wowWnd )
{
// The window is found.
//
return wowWnd;
}
else
return NULL;
}
void captureWoWWindow(HDC hTgtDC)
{
HWND hSrcWnd;
HDC hSrcDC;
// Get WoW Window Handle.
//
hSrcWnd = getWoWWindowHandle();
if( hSrcWnd )
{
hSrcDC = GetDC(hSrcWnd);
BitBlt(hTgtDC, 0, 0, 960, 640, hSrcDC, 0, 0, SRCCOPY | CAPTUREBLT);
ReleaseDC(hSrcWnd, hSrcDC);
}
return;
}
A collection of example source codes for c/c++ and ios and android platform. It also includes objective c.
Showing posts with label win32 screen capture. Show all posts
Showing posts with label win32 screen capture. Show all posts
Friday, May 6, 2011
Sunday, May 1, 2011
Windows Screen Capture sample code
Following code is a vc++ example for Screen Capture function.
Collected from http://www.ham-radio-deluxe.com/Support/SourceCode/WindowsScreenCapture.aspx
Collected from http://www.ham-radio-deluxe.com/Support/SourceCode/WindowsScreenCapture.aspx
| ||||||||
| ||||||||
Subscribe to:
Posts (Atom)